##
Maximizing Unique Pairs from two arrays
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 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 »

Given an array of binary integers, suppose these values are kept on the circumference of a circle at an equal distance. We need to tell… 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 »

We need to plot the perimeter points of a circle whose center co-ordinates and radius are given using the Mid-Point Circle Drawing Algorithm. We use… Read More »

We have discussed Huffman Encoding in a previous post. In this post decoding is discussed. Examples: Input Data : AAAAAABCCCCCCDDEEEEE Frequencies : A: 6, B:… Read More »

Given a number n and a digit d, count all occurrences of d in range from 0 to n. Examples: Input : n = 25… 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 14, 2017

We are given a sorted array A[] of n elements. We need to find if x is present in A or not.In binary search we… Read More »

We need to write N same characters on a screen and each time we can insert a character, delete the last character and copy and… Read More »

After going through previous post, we know what exactly are complex numbers and how we can use them to simulate points in a cartesian plane.… Read More »

While solving geometric problems, it is time consuming to define the point class for specifying a point on the 2D Plane or the Euclidean Plane.… Read More »

Given a range, print all numbers having unique digits. Examples: Input : 10 20 Output : 10 12 13 14 15 16 17 18 19… Read More »

June 13, 2017

You are standing on a point (n, m) and you want to go to origin (0, 0) by taking steps either left or down i.e.… Read More »

Given a value of angle, you need to calculate Sin and Cos values corresponding to it. For sin function Examples: Input : 90 Output :… Read More »