

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Term Definition
Node An entity that contains a value/data and pointers to its child nodes.
Root The topmost node of the tree. It has no parent.
Edge The link connecting two nodes.
Leaf A node with no children (the bottom-most nodes).
Height The length of the longest path from a node to a leaf.
Depth The length of the path from the root to a specific node.
Binary Tree: A tree where each node has at most two children (referred to as left child and right child). Binary Search Tree (BST): A specialized Binary Tree where the left child's value is less than the parent's value, and the right child's value is greater. Ideal for fast searching (O(log N)). AVL Tree / Red-Black Tree: Self-balancing Binary Search Trees that automatically adjust their structure to ensure operations remain O(log N) even in worst-case scenarios. Trie (Prefix Tree): A tree optimized for string and text operations, heavily used in autocomplete and spell-checking features. Heap: A specialized tree-based structure used to implement Priority Queues (Max-Heap and Min- Heap).
Depth-First Search (DFS)
Inorder Traversal
Returns values in sorted order for BSTs.
Preorder Traversal
Used to create a copy of the tree.
Postorder Traversal
Used to safely delete the tree.
Breadth-First Search (BFS)
Level Order Traversal