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 »
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 »
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 »
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 »
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 »
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 »
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 »
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 »
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 »
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 »
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 »
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 »
Hash Table supports following operations in Θ(1) time.
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 »
In the previous post, we discussed introduction to Red-Black Trees. In this post, insertion is discussed.