##
Find first k natural numbers missing in given array
July 25, 2017

Given an array of size n and a number k, we need to print first k natural numbers that are not there in given array.… Read More »

July 25, 2017

Given an array of size n and a number k, we need to print first k natural numbers that are not there in given array.… Read More »

July 24, 2017

Given an array of integers, sort the array according to frequency of elements. If frequencies of two elements are same, print them in increasing order.… Read More »

July 23, 2017

We are given an array of positive integers. Find the pair in array with maximum GCD. Examples: Input : arr[] : { 1 2 3… Read More »

Given a number n. Find sum of all number upto n whose 2 bits are set. Examples: Input : 10 Output : 33 3 +… Read More »

July 22, 2017

Many times while we do programming, we need to calculate the Least Common Multiple (LCM) between two numbers. We have already discussed how to find… Read More »

July 21, 2017

This a common question asked in DS interviews that despite of better worst case performance of merge sort, quicksort is considered better than mergesort. There… Read More »

July 18, 2017

An evil number is a non-negative number that has an even number of 1s in its binary expansion. (Binary Expansion – is representation of a… Read More »

Given a point P in 2-D plane and equation of mirror, the task is to find the image of that point Q formed due to… Read More »

Image Compression : Image is stored or transmitted with having pixel value. It can be compressed by reducing the value its every pixel contains. Image… Read More »

Given a number maximize it by swapping bits at it’s extreme positions i.e. at first and last position, second and second last position and so… Read More »

July 17, 2017

Given two non-negative numbers n and m. The problem is to find the smallest number having n number of set bits and m number of… Read More »

In computer graphics, we have seen how to draw some basic figures like line and circles. In this post we will discuss on basics of… Read More »

July 16, 2017

A shape is equable if its area is equal to its perimeter. Given ordered coordinates of polygon find whether the shape is equable or not.… Read More »

You are given a string of 2N characters consisting of N ‘[‘ brackets and N ‘]’ brackets. A string is considered balanced if it can… Read More »

Count the number of times a number can be replaced by the sum of its digits until it only contains one digit and number can… Read More »