Educational Cards
Learn from video content, text, and interactive tasks
Filters
Directed vs Undirected Graphs
Undirected edges are symmetric; directed edges have direction. In the adjacency list of an...
Left and right rotations
A right rotation around node y with left child x makes x the new root of the subtree and y the...
Complexity of Balanced Trees
Balanced search trees keep the height small enough that search, insertion, and deletion remain...
B-Trees Overview
B-trees store multiple keys per node and keep leaves at the same depth. They are designed for...
AVL Idea: Balance Factor
An AVL tree is a binary search tree in which the heights of the child subtrees differ by at most 1....
Insert with Rebalance
Insertion follows the search path as in a BST, attaching the node as a leaf and moving back up. At...
TreeMap vs HashMap
A sorted map in Java is based on a Red-Black Tree (balanced BST): ordered keys, O(log n) per...
Crossings: pre in post
Three depth traversal orders are common. One starts at the node and then visits the left and right...
Iterator for Trees
A tree iterator encapsulates the current position (often with an explicit stack for inorder). This...
Height and complete trees
The height of a tree is the length of the longest path from the root to a leaf (conventions vary by...
Recursive Tree Search
Searching in a binary tree: compare the key with the current node and descend left or right....
Binary Tree: Nodes and Structure
A binary tree consists of nodes with at most two children (left, right). The root has no parent...