# Tag Archives: Self-Balancing-BST (adsbygoogle = window.adsbygoogle || []).push({});

## Maximum subarray sum modulo m

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 »

## ScapeGoat Tree | Set 1 (Introduction and Insertion)

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 »

## Sort an array according to absolute difference with given value

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 »

## Maximum product of an increasing subsequence of size 3

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

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 »

## proto van Emde Boas Trees | Set 1 (Background and Introduction)

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 »

## Overview of Data Structures | Set 2 (Binary Tree, BST, Heap and Hash)

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 »

## Why is Binary Heap Preferred over BST for Priority Queue?

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 »

## How to sort a big array with many repetitions?

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 »

## How to handle duplicates in Binary Search Tree?

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 »

## Advantages of BST over Hash Table

Hash Table supports following operations in Θ(1) time. 1) Search 2) Insert 3) Delete The time complexity of above operations in a self-balancing Binary Search… Read More »

## C Program for Red Black Tree Insertion

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 »

## Red-Black Tree | Set 3 (Delete)

We have discussed following topics on Red-Black tree in previous posts. We strongly recommend to refer following post as prerequisite of this post. Red-Black Tree… Read More »

## Check if a given Binary Tree is height balanced like a Red-Black Tree

In a Red-Black Tree, the maximum height of a node is at most twice the minimum height (The four Red-Black tree properties make sure this… Read More »