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”