AVL Trees (Adelson-Velskii and Landis)

This tree is named after their inventors, Adelson-Velskii and Landis (AVL). An AVL tree is a balanced binary search tree. In this tree, pairs of sub-trees differ in height by at most 1, maintaining cost of operations to O(logn) time. Properties The sub-trees of every node differ in height by at most one Every sub-tree is an AVL tree. Balance FactorContinue reading “AVL Trees (Adelson-Velskii and Landis)”

Minimum Spanning Tree / Greedy Algorithms

A spanning tree is a sub-graph of an undirected connected graph, which includes all the vertices of the graph. If this sub-graph is achieved with minimum cost edges then it is said to be minimum spanning tree (MST) A greedy algorithm is an algorithm that is generally used in optimization problems. This algorithm makes the least expensiveContinue reading “Minimum Spanning Tree / Greedy Algorithms”

Understanding Heap

Heaps are regular binary trees with two special characteristics. (i) Complete Tree (ii) Order Property Heaps must be Complete Binary Trees. With order property it means that every node must have more(less) or equal key values than its child nodes. Heap is a special data structures that are useful for specific use-cases such as sorting andContinue reading “Understanding Heap”