##
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 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 11, 2017

Given a singly linked list containing n nodes. The problem is to sort the list using recursive selection sort technique. The approach should be such… Read More »

Here is a C++ code that illustrates that sorting the data miraculously makes the code faster than the unsorted version. Let’s try out a sample… Read More »

Sort the given biotonic doubly linked list. A biotonic doubly linked list is a doubly linked list which is first increasing and then decreasing. A… Read More »

July 5, 2017

Sort the doubly linked list using insertion sort technique. Initial doubly linked list Doubly Linked List after applying insertion sort Recommended: Please try your approach… Read More »

July 4, 2017

Given four sorted arrays each of size n of distinct elements. Given a value x. The problem is to count all quadruples(group of four numbers)… Read More »

Given an array A[] of n integers, the task is to find a subsequence of size k whose product is maximum among all possible k… Read More »

July 3, 2017

Given an array of both positive and negative numbers, the task is to find out the subarray whose sum is closest to 0. There can… Read More »

Given two linked lists(can be sorted or unsorted) of size n1 and n2 of distinct elements. Given a value x. The problem is to count… Read More »

July 1, 2017

Given a stack of integers, sort it in ascending order using another temporary stack. Examples: Input : [34, 3, 31, 98, 92, 23] Output :… Read More »

June 30, 2017

Given two arrays of integers, find a pair of values (one value from each array) that you can swap to give the two arrays the… Read More »

June 29, 2017

Given an array of integers, print the array in such a way that the first element is first maximum and second element is first minimum… Read More »

June 25, 2017

The Selection Sort algorithm sorts maintains two parts. First part that is already sorted Second part that is yet to be sorted. The algorithm works… Read More »