## Print Fibonacci sequence using 2 variables

Print the Fibonacci sequence. The first Fibonacci numbers are: C++ filter_none edit close play_arrow link brightness_4 code // Simple CPP Program to print Fibonacci //… Read More »

Print the Fibonacci sequence. The first Fibonacci numbers are: C++ filter_none edit close play_arrow link brightness_4 code // Simple CPP Program to print Fibonacci //… Read More »

Suppose we have four variables a, b, c, d and we want to perform swapping of these variables in the following manner a = b,… Read More »

Design a data structure which can do following operations add() in O(n) getMinimum() in O(1) deleteMinimum() in O(1) Source : MakeMyTrip Interview. Recommended: Please try… Read More »

Given starting and ending position and a number N. Given that we are allowed to move in only four directions as shown in the image… Read More »

Place the numbers 1, 2, 3, 4, 5, 6, 7, 8 into the eight circles in the figure given below, in such a way that… Read More »

A Pythagorean Triplet is a set of natural numbers such that a < b < c, for which a^2 + b^2 = c^2. For example,… Read More »

You are a poor person in an island. There is only one shop in this island, this shop is open on all days of the… Read More »

Given two integers N and D, Find a set of N integers such that difference between their product and sum is equal to D. Examples… Read More »

Given a room with square grids having ‘*’ and ‘.’ representing untidy and normal cells respectively. You need to find whether room can be cleaned… Read More »

Given n non-negative integers where each represents a point at coordinate . ‘ n ‘ vertical lines are drawn such that the two endpoints of… Read More »

Given an array of n elements.You can double or triple the elements in the array any number of times. After all the operations check whether… Read More »

Given a Linked List, display the linked list in reverse without using recursion, stack or modifications to given list. Examples: Input : 1->2->3->4->5->NULL Output :5->4->3->2->1->NULL… Read More »

Given an array of non-negative integers. We need to construct given array from an array of all zeros. We are allowed to do following operation.… Read More »

Given a number N, check if it is positive, negative or zero without using conditional statements. Examples: Input : 30 Output : 30 is positive… Read More »

Given an array A[] of non-negative integers, find the maximum in the array without using Relational Operator. Examples: Input : A[] = {2, 3, 1,… Read More »