##
Find N’th item in a set formed by sum of two arrays
March 12, 2017

Given two sorted arrays, we can get a set of sums(add one element from the first and one from second). Find the N’th element in… Read More »

March 12, 2017

Given two sorted arrays, we can get a set of sums(add one element from the first and one from second). Find the N’th element in… Read More »

March 2, 2017

Given an array of n elements and an integer m. The task is to find the maximum value of the sum of its subarray modulo… Read More »

February 13, 2017

A ScapeGoat tree is a self-balancing Binary Search Tree like AVL Tree, Red-Black Tree, Splay Tree, ..etc. Search time is O(Log n) in worst case.… Read More »

December 22, 2016

Given an array of n distinct elements and a number x, arrange array elements according to the absolute difference with x, i. e., element having… Read More »

December 17, 2016

Given an array of distinct positive integers, the task is to find the maximum product of increasing subsequence of size 3, i.e., we need to… Read More »

October 19, 2016

Tree sort is a sorting algorithm that is based on Binary Search Tree data structure. It first creates a binary search tree from the elements… Read More »

October 10, 2016

Let us consider the below problem statement and think of different solutions for it. Given a set S of elements such that the elements are… Read More »

February 8, 2016

We have discussed Overview of Array, Linked List, Queue and Stack. In this article following Data Structures are discussed. 5. Binary Tree 6. Binary Search… 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 »

September 7, 2015

A typical Priority Queue requires following operations to be efficient. Get Top Priority Element (Get minimum or maximum) Insert an element Remove top priority element… Read More »

July 10, 2015

Consider a big array where elements are from a small set and in any range, i.e. there are many repetitions. How to efficiently sort the… Read More »

May 11, 2015

In a Binary Search Tree (BST), all keys in left subtree of a key must be smaller and all keys in right subtree must be… Read More »

April 1, 2015

Hash Table supports following operations in Θ(1) time.

August 4, 2014

Following article is extension of article discussed here. In AVL tree insertion, we used rotation as a tool to do balancing after insertion caused imbalance.… Read More »

February 16, 2014

In the previous post, we discussed introduction to Red-Black Trees. In this post, insertion is discussed.