Skip to content

Tag Archives: Fibonacci

Given a range, count Fibonacci numbers in given range. First few Fibonacci numbers are 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55,… Read More
Given a sorted array arr[] of size n and an element x to be searched in it. Return index of x if it is present… Read More
Fibonacci coding encodes an integer into binary number using Fibonacci Representation of the number. The idea is based on Zeckendorf’s Theorem which states that every… Read More
Zeckendorf’s theorem states that every positive integer can be written uniquely as a sum of distinct non-neighbouring Fibonacci numbers. Two Fibonacci numbers are neighbours if… Read More
Recently Payu came for recruitment in our college. Hiring Process : Online Test + 3 Technical Rounds + HR Round. Position : Software Engineer Online… Read More
Heaps are mainly used for implementing priority queue. We have discussed below heaps in previous posts. Binary Heap Binomial Heap In terms of Time Complexity,… Read More
Given a “2 x n” board and tiles of size “2 x 1”, count the number of ways to tile the given board using the… Read More
Given an input number of sections and each section has 2 plots on either sides of the road. Find all possible ways to construct buildings… Read More
Let 1 represent ‘A’, 2 represents ‘B’, etc. Given a digit sequence, count the number of possible decodings of the given digit sequence.  Examples:  Input:… Read More
Given a positive integer N, count all possible distinct binary strings of length N such that there are no consecutive 1’s. Examples: Input: N =… Read More
Following is a simple program to print first n Fibonacci numbers.  Examples :  Input : n = 3 Output : 0 1 1 Input :… Read More
We have discussed different methods to find nth Fibonacci Number. Following is another mathematically correct way to find the same. nth Fibonacci Number : Here… Read More
Given a number ‘n’, how to check if n is a Fibonacci number. First few Fibonacci numbers are 0, 1, 1, 2, 3, 5, 8,… Read More
Dynamic Programming is an algorithmic paradigm that solves a given complex problem by breaking it into subproblems and stores the results of subproblems to avoid… Read More
The Fibonacci numbers are the numbers in the following integer sequence.0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, …….. In… Read More