## 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 »

## Swapping four variables without temporary variable

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 »

## Data Structure design to perform required operations

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 »

## Reaching a point using clockwise or anticlockwise movements

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 »

## Fill 8 numbers in grid with given conditions

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 »

## Pythagorean Triplet with given sum

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 »

## Check if it is possible to survive on Island

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 »

## Find N integers with given difference between product and sum

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 »

## Container with Most Water

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 »

## Check if it is possible to make array equal by doubling or tripling

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 »

## Print reverse of a Linked List without extra space and modifications

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 »

## Count of suffix increment/decrement operations to construct a given array

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 »

## Check if a number is positive, negative or zero using bit operators

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 »

## Find maximum in an array without using Relational Operators

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 »