Trees

A tree is a hierarchical structure in which data is organized hierarchically and linked to each other. This structure is different from a linked list, and in a linked list, items are linked in a linear order. In the past few decades, various types of trees have been developed to suit certain applications and meet certain restrictions.

Some examples are binary search trees, B-trees, treap, red-black trees, expanded trees, AVL trees, and n-ary trees. Binary search tree Binary search tree (BST), as the name suggests, is a binary tree where data can be found.