##
Recursive Selection Sort
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 »

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 »

June 23, 2017

Given two sorted arrays of size m and n of distinct elements. Given a value x. The problem is to count all pairs from both… Read More »

June 22, 2017

Prerequisite : Bubble Sort Write a function that sort an array of integers using stacks and also uses bubble sort paradigm. Recommended: Please try your… Read More »

June 21, 2017

Given an array of n distinct elements. Check whether the given array is a k sorted array or not. A k sorted array is an… Read More »

June 16, 2017

Given two arrays of equal size N, form maximum number of pairs by using their elements, one from the first array and second from the… Read More »

June 15, 2017

Given an array of words, find all shortest unique prefixes to represent each word in the given array. Assume that no word is a prefix… Read More »

Problem Statement: Given a set of strings, find the longest common prefix. Examples: Input : {“geeksforgeeks”, “geeks”, “geek”, “geezer”} Output : “gee” Input : {“apple”,… Read More »

Given an array of n distinct integers. The problem is to find the sum of minimum absolute difference of each array element. For an element… Read More »

June 11, 2017

Given an array of strings, sort the array using Selection Sort. Examples: Input : paper true soap floppy flower Output : floppy, flower, paper, soap,… Read More »

June 10, 2017

Also known as Gravity sort, this algorithm was inspired from natural phenomenons and was designed keeping in mind objects(or beads) falling under the influence of… Read More »

June 8, 2017

Given a sequence of n strings, the task is to check if any two similar words come together then they destroy each other then print… Read More »

May 29, 2017

Given an array of positive integers. Sort the given array in decreasing order of number of factors of each element, i.e., element having the highest… Read More »

May 24, 2017

Given an array of n strings. The task is to print the strings in sorted order. The approach should be such that no string should… Read More »

May 20, 2017

We have an integer array that is sorted in ascending order. We also have 3 integers A, B and C. We need to apply A*x*x… Read More »

May 19, 2017

TimSort is a sorting algorithm based on Insertion Sort and Merge Sort. A stable sorting algorithm works in O(n Log n) time Used in Java’s… Read More »