1/11
Flashcards covering key concepts, vocabulary, algorithms, and deletion/insertion procedures for Binary Search Trees based on lecture notes.
Binary Search Tree (BST)
A dynamic data structure that organizes data in a way that makes searching, inserting, and deleting efficient while maintaining the binary-search-tree property.
Autocomplete System
A web application feature that uses a BST to store product names alphabetically and execute fast queries to fetch suggestions starting with typed characters.
TREE-INSERT(T, z)
A procedure that inserts a node z (where z.key=v and z.left=z.right=NIL) into a binary search tree T by tracing a simple downward path to an appropriate position.
Trailing Pointer y
A pointer maintained during TREE−INSERT as the parent of pointer x, used to update the parent attribute z.p when x reaches NIL.
TRANSPLANT(T, u, v)
A BST subroutine that replaces the subtree rooted at node u with the subtree rooted at node v as a child of u's parent.
TREE-DELETE(T, z)
A procedure that removes a specified node z from a binary search tree T, organizing cases based on whether z has zero, one, or two children.
Successor Node y
The node with the smallest key in node z's right subtree (retrieved via TREE−MINIMUM(z.right)), used to replace z when z has two children during deletion.
BST Deletion: No Children Case
A deletion situation where node z has no children, handled by modifying its parent to replace z with NIL.
BST Deletion: One Child Case
A deletion situation where node z has just one child, handled by elevating that child to take z's position in the tree by modifying z's parent.
BST Deletion: Two Children Case
A deletion situation where node z has two children, requiring its successor y in the right subtree to be spliced out and elevated to replace z.
In-order Traversal
A tree traversal technique that visits and prints the nodes of a binary search tree in alphabetically or numerically sorted order.
Java compareTo() Method
A Java method for string comparison that returns 0 when two compared strings are identical.