##
Treap (A Randomized Binary Search Tree)
October 22, 2015

Like Red-Black and AVL Trees, Treap is a Balanced Binary Search Tree, but not guaranteed to have height as O(Log n). The idea is to… Read More »

October 22, 2015

Like Red-Black and AVL Trees, Treap is a Balanced Binary Search Tree, but not guaranteed to have height as O(Log n). The idea is to… Read More »

October 14, 2015

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

October 8, 2015

Heaps are mainly used for implementing priority queue. We have discussed below heaps in previous posts. Binary Heap Binomial Heap In terms of Time Complexity,… Read More »

October 6, 2015

We strongly recommend to refer below posts as a prerequisite of this. K Dimensional Tree | Set 1 (Search and Insert) K Dimensional Tree |… Read More »

October 5, 2015

We strongly recommend to refer below post as a prerequisite of this. K Dimensional Tree | Set 1 (Search and Insert) In this post find… Read More »

September 18, 2015

Segment tree is introduced in previous post with an example of range sum problem. We have used the same “Sum of given Range” problem to… Read More »

June 27, 2015

How to design a system that takes big URLs like “http://www.geeksforgeeks.org/count-sum-of-digits-in-numbers-from-1-to-n/” and converts them into a short 6 character URL.

April 9, 2015

Design a data structure that supports following operations in Θ(1) time. insert(x): Inserts an item x to the data structure if not already present. remove(x):… Read More »

April 4, 2015

Unlike C++ and Java, C doesn’t support generics. How to create a linked list in C that can be used for any data type? In… Read More »

December 28, 2014

Given a string, find the longest substring which is palindrome. We have already discussed Naïve [O(n3)], quadratic [O(n2)] and linear [O(n)] approaches in Set 1,… Read More »

December 17, 2014

We have discussed implementation of Reverse DNS Look Up Cache. Forward DNS look up is getting IP address for a given domain name typed in… Read More »

December 11, 2014

Let us consider the following problem to understand Binary Indexed Tree.

December 10, 2014

Reverse DNS look up is using an internet IP address to find a domain name. For example, if you type 74.125.200.106 in browser, it automatically… Read More »

November 18, 2014

Given two strings X and Y, find the Longest Common Substring of X and Y. Naive [O(N*M2)] and Dynamic Programming [O(N*M)] approaches are already discussed… Read More »

November 17, 2014

In earlier suffix tree articles, we created suffix tree for one string and then we queried that tree for substring check, searching all patterns, longest… Read More »