What is a Tree data structure? A tree is a non-linear data structure that consists of nodes connected by edges , where each node can have zero or more children nodes . The topmost node of a tree is called the root node , and nodes with no children are called leaf nodes . There are several types of trees: Binary Tree : A binary tree is a tree in which each node has at most two children. Binary Search Tree (BST): A binary search tree is a binary tree in which the left subtree of a node contains only nodes with keys less than the node's key, and the right subtree contains only nodes with keys greater than the node's key. AVL Tree: An AVL tree is a self-balancing binary search tree in which the heights of the left and right subtrees of any node differ by at most one. B-Tree: A B-tree is a self-balancing tree in which each node can have more than two children. Trie: A trie is a tree-like data structure used to store a set of strings, where each node represents a single character...
Quick Reference for System Design, Architecture and Cloud Engineering Interviews