Fact-checked by Grok 2 weeks ago

Search tree

A search tree is a hierarchical data structure in computer science designed to store and organize a collection of keys in sorted order, enabling efficient operations such as searching, insertion, and deletion, typically with an average time complexity of O(log n) for n elements. These structures leverage the tree's branching to mimic binary or multi-way search processes, reducing the number of comparisons needed compared to linear search methods. The foundational example of a search tree is the , a where each contains a , and for any , all keys in the left subtree are strictly less than the node's , while all keys in the right subtree are strictly greater. This ordering property allows searches to proceed by recursively navigating left or right from the root, potentially halving the search space at each step in a balanced tree. However, unbalanced BSTs can degrade to O(n) performance in the worst case, resembling a , which motivates balanced variants. To ensure consistent logarithmic performance, several balanced search tree implementations exist, including , which maintain balance by enforcing a height difference of at most one between subtrees through rotations after insertions or deletions. achieve balance using node colors (red or black) to guarantee that no path from root to leaf is more than twice as long as another, with self-balancing adjustments via rotations and recoloring. These structures are widely used in programming language libraries, such as Java's TreeMap and C++'s std::map. For applications involving large datasets or disk-based storage, multi-way search trees like B-trees extend the concept by allowing nodes to have multiple children (typically between m/2 and m for order m), minimizing disk I/O by keeping the tree height low and nodes bushy. B-trees, invented by and Edward M. McCreight in 1970, are fundamental in database indexing systems like those in and , where they support range queries and handle variable-sized blocks efficiently. Variants such as B+-trees further optimize for by storing data only in leaves and using internal nodes solely for indexing. Search trees are essential in numerous domains, including file systems, compilers for symbol tables, and real-time systems requiring fast lookups, underscoring their role as a cornerstone of efficient algorithm design.

Definition and Properties

Core Concept

A search tree is a tree data structure used to store a collection of keys in a manner that facilitates efficient searching, insertion, and deletion operations on dynamic sets. It typically organizes keys hierarchically while maintaining an ordering invariant: for any node, all keys in its left subtree are less than the node's key, and all keys in its right subtree are greater than the node's key. This structure extends general tree concepts—such as nodes connected by edges, with a root and leaves—to support ordered data management, assuming familiarity with basic tree terminology like parent-child relationships and subtrees. The concept of search trees emerged in the early 1960s as part of efforts to optimize data organization in computing systems. One of the earliest descriptions appeared in P. F. Windley's 1960 paper "Trees, Forests and Rearranging" on tree-based rearranging methods for efficient storage and retrieval. The term and its formal properties were further systematized by Donald Knuth in his seminal work The Art of Computer Programming, Volume 3: Sorting and Searching, published in 1973, where search trees are analyzed as a foundation for balanced searching algorithms. For illustration, consider a simple search tree storing keys: the root node holds 5, its left child is 3, and its right child is 7. This satisfies the ordering invariant, as 3 < 5 < 7, enabling quick location of any key by traversing left or right based on comparisons. The binary search tree represents the simplest form of this structure.

Fundamental Properties

Search trees are characterized by a fundamental ordering invariant that facilitates efficient key-based searching. In binary variants, such as the binary search tree, this invariant stipulates that for any node containing key k, all keys in the left subtree are strictly less than k, while all keys in the right subtree are strictly greater than k. This property generalizes to multi-way search trees, where keys within each node are maintained in sorted order, and the subtrees between consecutive keys in a node contain exclusively smaller or larger keys relative to those boundaries. A key structural assumption in search trees is the absence of duplicate keys, ensuring uniqueness within the structure; duplicates, if permitted, are typically managed through multiplicity counts or auxiliary storage rather than violating the ordering. The height h of the tree plays a central role in performance, with balanced trees achieving an average height of O(\log n) for n nodes, in contrast to the worst-case O(n) height in skewed configurations, which underscores the distinction between amortized and worst-case analyses. For , the maximum number of nodes is bounded by the full binary tree formula: n \leq 2^{h+1} - 1 This bound highlights how balance minimizes height to logarithmic scale. Core operations—search, insertion, and deletion—each require time proportional to the tree's height, yielding O(h) complexity; in balanced search trees, this simplifies to O(\log n), enabling their utility in dynamic data management. As exemplified in the binary search tree, adherence to the ordering invariant directly supports these bounds by allowing traversal decisions based on key comparisons alone.

Types of Search Trees

Binary Search Tree

A binary search tree (BST) is a type of where each node contains a key and has at most two children, designated as the left child and the right child. The structure adheres to the : for any node, all keys in the left subtree are strictly less than the node's key, and all keys in the right subtree are strictly greater than the node's key. This invariant ensures that the tree maintains a sorted order among its elements. BSTs are constructed through sequential insertion of keys, starting from an empty tree. During insertion, the new key is compared to the keys of existing nodes, traversing left if smaller or right if larger until an appropriate leaf position is found, where the new node is attached while preserving the BST property. One key advantage of BSTs is their simplicity in implementation, requiring only basic pointer operations for node management. Additionally, they facilitate ordered traversals; an in-order traversal (visiting left subtree, node, then right subtree) produces the keys in non-decreasing sorted order without additional sorting effort. However, a significant limitation arises from potential imbalance: if keys are inserted in monotonically increasing or decreasing order, the tree degenerates into a linear chain resembling a linked list, where search, insertion, and deletion operations degrade to O(n) time complexity in the worst case. In a randomly constructed BST, the expected height is O(log n), supporting average-case O(log n) performance for these operations. To illustrate construction, consider inserting the sequence of keys {3, 1, 4, 2, 5} into an empty :
  • Insert 3: The tree consists of a single root node with key 3.
  • Insert 1: Compare with 3 (1 < 3), attach as left child of 3.
  • Insert 4: Compare with 3 (4 > 3), attach as right child of 3.
  • Insert 2: Compare with 3 (2 < 3), then with 1 (2 > 1), attach as right child of 1.
  • Insert 5: Compare with 3 (5 > 3), then with 4 (5 > 4), attach as right child of 4.
The resulting tree structure is:
      3
     / \
    1   4
     \   \
      2   5
This example demonstrates how comparisons guide placement while enforcing the BST property. The basic structure for a BST in is typically represented as follows:
[class](/page/Class) Node:
    key
    left = [null](/page/Null)
    right = [null](/page/Null)
This minimal design supports the core tree operations through recursive or iterative traversal using the left and right pointers.

B-Tree

A B-tree is a self-balancing multiway search tree that generalizes the binary search tree, allowing each internal node to have multiple children—specifically, between \lceil m/2 \rceil and m children for a tree of order m—to efficiently handle large datasets stored on secondary storage like disks. The keys within each node divide the key space for its child subtrees, preserving the search tree invariant: all keys in a left subtree are less than the node's smallest key, and all keys in a right subtree are greater than its largest key. Invented by Rudolf Bayer and Edward M. McCreight in 1970 for organizing large ordered indexes, B-trees minimize disk I/O by keeping the tree height low and nodes bushy, as each node access typically requires a full block read. B-trees maintain balance such that all leaves reside at the same level, achieved through dynamic splitting and redistribution: during insertion, if a fills to capacity, it splits into two nodes with the key promoted to the ; during deletion, underfull nodes borrow keys from siblings or merge with them to avoid violating minimum occupancy. This parameterization often uses a minimum degree t \geq 2, where non-root nodes hold at least t-1 keys (and t children) and at most $2t-1 keys (and $2t children), while the root has at least 1 key unless it is a . The resulting height is h = O(\log_t n), where n is the number of keys, ensuring logarithmic-time operations even for millions of entries, as the t (often 100–1000 for disk blocks) reduces levels to 3–4 for terabyte-scale indexes. B-trees are foundational in database indexing for file systems and relational databases, where they support efficient range queries and ordered access; for instance, MySQL's engine uses a variant (a where leaves link sequentially and internal nodes store only keys) for clustered primary indexes and secondary indexes.

Example: Insertion in a of Minimum Degree t=2

Consider building a with minimum degree t=2 (non-root nodes hold 1–3 keys, 2–4 children for internal nodes) by inserting keys 1, 2, 3, 4, 5, 6 in sequence, highlighting a split.
  • Insert 1: Root becomes (a leaf).
  • Insert 2: Root becomes [1, 2].
  • Insert 3: Root becomes [1, 2, 3] (full).
  • Insert 4: Root is full; split into [1, 2] and , promote median 2 to new root , left child , right child ; then insert 4 into right child, becoming [3, 4].
  • Insert 5: Traverse to right leaf [3, 4] (not full), insert to become [3, 4, 5] (now full, but no split as it does not exceed maximum).
  • Insert 6: Traverse to right leaf [3, 4, 5] (full); temporarily insert to [3, 4, 5, 6], then split: promote median 4 to parent (root becomes [2, 4]), left of 4 is , right of 4 is [5, 6]; overall children: , , [5, 6].
The after inserting 6 has root [2, 4], with children , , [5, 6]. This demonstrates the : when inserting into a full causes (more than 3 keys temporarily), it, promote the , and adjust the . Such operations ensure the remains balanced, with search/insert/delete costing O(h) accesses, or O(\log_t n) time.

Other Variants

(a,b)-trees generalize B-trees by allowing internal s to have between a and b children, where 1 ≤ ab/2, providing flexibility in without the strict splitting rules of standard B-trees. This structure enables tunable balance and is particularly useful in scenarios requiring variable capacities to optimize and patterns. Introduced by Huddleston and Mehlhorn in 1982 as a new for representing sorted lists, (a,b)-trees support the same logarithmic-time operations as B-trees while offering greater adaptability. The B-tree is a special case of an (a,b)-tree where a = ⌈b/2⌉. A 2-3 tree is a specific instance of a of order 3, where each internal node has either 2 or 3 children, ensuring height balance and efficient search, insertion, and deletion in O(log n) time. Invented by John Hopcroft in 1970, 2-3 trees serve as a foundational balanced multiway search tree, predating broader B-tree variants. Ternary search trees extend binary search trees to three children per node—typically low, equal, and high—optimized for prefix-based string searches by combining trie-like compression with binary search ordering. This hybrid structure excels in lexicographic operations, such as or lookups, achieving space efficiency comparable to tries while maintaining fast query times. Popularized by and Sedgewick in 1998, ternary search trees are particularly effective for datasets involving variable-length strings. Scapegoat trees are binary search trees that maintain approximate balance through lazy rebuilding of unbalanced subtrees, identifying a "scapegoat" node with excessive height to trigger reconstruction into a perfectly balanced tree. This approach amortizes costs over insertions, ensuring O(log n) time per operation with high probability, without the overhead of constant rotations. Developed by Galperin and Rivest in 1993, scapegoat trees provide a simple alternative to strictly balanced structures like AVL trees. Among these variants, ternary search trees are suited for lexicographic string ordering due to their prefix-handling capabilities, while (a,b)-trees offer tunable balance for applications needing adjustable sizes, such as database indexing.

Operations on Search Trees

Search Procedures

Search procedures in search trees rely on the ordered structure to efficiently locate s through directional traversal from the . To find a specific , the algorithm begins at the and compares the with the current 's : if the is less than the current , it traverses to the left subtree; if greater, to the right subtree. This process continues until the is found or a (indicating absence) is reached. The search can be implemented recursively or iteratively. In the recursive version, a function is called on the appropriate subtree based on the comparison, with base cases for nodes (returning failure) or exact matches (returning the ). The following illustrates this for a :
TREE-SEARCH(x, k)
    if x = NIL or k = x.key
        return x
    if k < x.key
        return TREE-SEARCH(x.left, k)
    else
        return TREE-SEARCH(x.right, k)
This approach mirrors the iterative method, which uses a loop to update the current pointer without stack overhead. Iterative is:
procedure find(key)
    p ← root
    while p ≠ NIL and key ≠ p.key
        if key < p.key
            p ← p.left
        else
            p ← p.right
    return p
Both variants take time proportional to the tree's height h, yielding O(h) complexity; in balanced trees where h = O(\log n), search is O(\log n). Finding the minimum or maximum is a specialized traversal that follows the ordering . The minimum is the leftmost , obtained by repeatedly moving left from the until a left child is encountered. for minimum is:
TREE-MINIMUM(x)
    while x.left ≠ NIL
        x ← x.left
    return x
The maximum is symmetrically found by traversing rightmost. These operations also run in O(h) time, or O(\log n) in balanced trees. Search trees may handle duplicates differently depending on the implementation: some policies disallow them entirely to maintain unique keys, while others permit multiples by placing equals in the left or right subtree during insertion, with search returning any matching node (or all via extended traversal if required). In standard binary search trees without duplicates, search terminates on the first match.

Insertion and Deletion

Insertion in search trees follows a procedure analogous to for the , traversing from the to a position where the new would be located if it existed, and then adding a new leaf at that spot to preserve the ordering . In binary search trees (BSTs), this process is straightforward: the new becomes the child of the last non- encountered during the traversal, with its left and right pointers initialized to . The is O(h), where h is the tree height, which remains O(\log n) in balanced trees. The following pseudocode illustrates recursive insertion in a BST, assuming a tree T with root r and a new node z containing the key to insert:
TREE-INSERT(T, z)
1 y ← NIL
2 x ← T.root
3 while x ≠ NIL
4     y ← x
5     if z.key < x.key
6         x ← x.left
7     else
8         x ← x.right
9 z.p ← y
10 if y = NIL
11     T.root ← z
12 elseif z.key < y.key
13     y.left ← z
14 else
15     y.right ← z
This algorithm ensures the BST property by placing z as a leaf after following the search path. In B-trees, insertion begins similarly by locating the appropriate leaf via search, but if the leaf overflows its maximum capacity (typically $2t-1 keys for minimum degree t), it is split into two nodes, with the median key promoted to the parent to maintain balance. This splitting may propagate upward if the parent also overflows, potentially creating a new root and increasing the height by one, ensuring all leaves remain at the same level. Deletion in search trees removes a while adjusting the structure to uphold the ordering , handling three primary cases based on the number of children of the containing the . For a leaf (zero children), it is simply removed by setting its 's pointer to . In the case of one child, the is bypassed by linking the directly to that child. For two children, the 's is replaced with its inorder successor (the minimum in the right subtree), and then the successor—now a with at most one child—is deleted as above. This maintains O(h) time complexity, or O(\log n) in balanced trees. Consider a BST example for deleting a with two children: suppose the has z with key 13, left child 8, and right child 18 (which has left child ). The successor is (minimum in 18's subtree). Replace 13 with , making 18 the right child of the new position, then delete the original (a ) from under 18. The following for BST deletion uses a helper to find the successor:
TREE-DELETE(T, z)
1 if z.left = NIL or z.right = NIL
2     y ← z
3 else
4     y ← TREE-MINIMUM(z.right)
5 if y.left ≠ NIL
6     x ← y.left
7 else
8     x ← y.right
9 if x ≠ NIL
10     x.p ← y.p
11 if y.p = NIL
12     T.[root](/page/Root) ← x
13 elseif y = y.p.left
14     y.p.left ← x
15 else
16     y.p.right ← x
17 if y ≠ z
18     z.[key](/page/Key) ← y.[key](/page/Key)
19 return y
In B-trees, deletion starts by removing the from a ; if underflow occurs (fewer than t-1 keys), the node borrows a from a via the if the sibling has at least t keys, or merges with the sibling otherwise, pulling a from the into the merged . For internal s, the is first replaced by its successor or predecessor from a , then deleted from that with underflow handling. Merges may propagate upward, and if the underflows to empty, the height decreases. These operations preserve the balanced structure, yielding O(\log_t n) time, or amortized O(\log n).

Advanced Topics

Balancing Mechanisms

Balancing mechanisms in search trees are techniques designed to maintain a logarithmic height, preventing degeneration into linear structures during insertions and deletions. These methods ensure efficient search, insertion, and deletion operations with O() time complexity by enforcing structural invariants through local adjustments like rotations or node recoloring. Common approaches include height-based balancing in AVL trees, color-based balancing in red-black trees, and self-adjusting heuristics in splay trees. AVL trees are height-balanced binary search trees where the height difference between the left and right subtrees of any node, known as the balance factor, is at most 1 in absolute value. This invariant is maintained after insertions and deletions through a series of single or double rotations to restore balance. Single rotations handle cases where the imbalance occurs in the child subtree aligned with the insertion site, while double rotations address zig-zag imbalances involving both child and grandchild subtrees. The original AVL tree algorithm was introduced by Adelson-Velsky and Landis in 1962. Rotations in AVL trees preserve the in-order traversal and properties while adjusting heights. For a right on a y with left x, the transformation sets x as the new , attaches y as the right of x, and updates y's left to x's original right :
Before:     y              After:    x
           / \                        / \
          x   C                      A   y
         / \                           / \
        A   B                         B   C
This operation reduces the height difference at y by rebalancing the subtrees. Similar left rotations and double rotations (left-right or right-left) are used for other cases, ensuring the balance factor remains within [-1, 1] along the affected path. A concrete example illustrates AVL balancing during insertion. Starting with an empty tree, insert 3 to create a root node. Inserting 1 makes it the left child, yielding a balanced tree with balance factor 1 at the root. Inserting 2 then attaches as the right child of 1, violating the balance at the root (left height 2, right height 0). This requires a left-right double rotation: first perform a left rotation on the left child of 3 (node 1, promoting 2 as the new left child of 3), then perform a right rotation on 3 (promoting 2 as root with 1 left and 3 right), restoring balance with all factors at 0. Red-black trees achieve balance using node colors (red or black) rather than explicit heights, with five key properties: every node is colored, the root is black, all leaves (NIL nodes) are black, no two red nodes are adjacent (red nodes have black children), and every path from a node to its descendant leaves contains the same number of black nodes (equal black-height). Violations after insertion or deletion are fixed through recoloring and at most three rotations, prioritizing local fixes from the bottom up. This framework was developed by Guibas and Sedgewick in as a binary representation of 2-3-4 trees. The color properties ensure that the height h of a red-black tree with n internal nodes satisfies h ≤ 2 ₂(n+1), which is asymptotically worse than AVL trees' stricter 1.44 n bound but simpler to implement due to fewer rotations on average. The upper bound follows from the minimum number of nodes in a full of black height bh being at least 2^{bh} - 1, with bh₂(n+1), and h ≤ 2 bh due to alternating colors. Splay trees are self-adjusting binary search trees that do not maintain a strict balance invariant but instead perform amortized O(log n) operations by "splaying" recently accessed nodes to the root through a sequence of zig, zig-zig, or zig-zag rotations. These rotations recenter the accessed node without relying on colors or heights, promoting frequently accessed elements for faster future operations under the static optimality property. Splay trees were introduced by Sleator and Tarjan in , offering adaptive performance superior to fixed-balance trees for non-uniform access patterns.

Applications and Comparisons

Search trees find widespread application in software systems requiring efficient ordered . Binary search trees (BSTs) and their self-balancing variants, such as red-black trees, are commonly used for in-memory data structures like sorted sets and maps. For instance, Java's TreeMap class implements a red-black tree to provide logarithmic-time operations for insertion, deletion, and lookup of key-value pairs, enabling efficient handling of ordered collections in applications ranging from caching to configuration management. B-trees, on the other hand, are integral to disk-based storage systems due to their ability to minimize operations. In file systems like , B-trees index directory entries and , allowing for scalable organization of large volumes of data on secondary storage. Similarly, databases leverage B-trees for indexing to support fast queries over persistent data. Ternary search trees excel in string-heavy scenarios, such as features in search engines and text editors, where they efficiently store and retrieve words with common prefixes by branching on character comparisons. When comparing search tree variants, their design choices reflect trade-offs in balance, complexity, and performance suited to specific environments. Plain BSTs offer simplicity in implementation but risk degeneration into linear chains under adversarial insertions, leading to O(n) worst-case time for operations. AVL trees enforce strict balance by limiting height differences to one, ensuring O(log n) guarantees but requiring more frequent rotations during insertions and deletions, which can increase overhead in dynamic workloads. Red-black trees, by contrast, allow slightly looser balance through color rules, resulting in fewer rotations and better practical performance for insertions, making them a staple in systems like the Linux kernel for scheduling and memory management tasks. B-trees prioritize high fanout to reduce tree height in external memory contexts, where each node access incurs costly disk I/O, though they demand more space per node compared to binary variants. Key trade-offs across these structures involve space efficiency, time complexity, and key type suitability. B-trees achieve denser packing with variable-order nodes, using less overall space for large datasets than binary trees, but balanced binary trees like AVL and red-black provide tighter O(log n) bounds in main memory without the fanout overhead. Unbalanced BSTs can degrade to O(n) time, while balanced variants maintain consistency at the cost of rotational maintenance. For numeric keys, binary search trees suffice, but string keys benefit from ternary structures, which compress paths and support prefix-based retrieval more effectively than binary alternatives. As of 2025, variants—where leaf nodes link sequentially for range scans—remain dominant in database indexing, including systems like , which employs B-trees for efficient query optimization over distributed data. Emerging adaptations focus on resilience in constrained environments, though quantum-resistant modifications to core search tree structures are still in early research phases, primarily influencing related mechanisms rather than operational search algorithms.
Tree TypeHeight GuaranteeFanoutPrimary Use Case
BSTO(log n) average; O(n) worst2 (binary)Simple in-memory ordered storage
AVLO(log n) strict2 ()Search-intensive applications
Red-BlackO(log n) approximate2 ()Dynamic in-memory operations (e.g., kernels)
B-TreeO(log n) with high orderVariable (high), databases/filesystems

References

  1. [1]
    [PDF] Chapter 15 Binary Search Trees (BSTs)
    A binary search tree is a binary tree in which we assign a key to every node, and for each key. (node) all keys in its left subtree are less than it, and all ...
  2. [2]
    Search Trees
    A search tree is a tree that stores information for searching. The tree above is just one of many, many approaches to speeding up search with trees.
  3. [3]
    Binary Search Trees
    A binary search tree (BST) is a dynamic data structure that combines linked list flexibility with array efficiency, using nodes with key, data, and two ...
  4. [4]
    7.11. Binary Search Trees — CS3 Data Structures & Algorithms
    Binary Search Tree Definition¶. A binary search tree (BST) is a binary tree that conforms to the following condition, known as the binary search tree property.
  5. [5]
    B-Trees - UT Computer Science
    B-Trees are a variation on binary search trees that allow quick searching in files on disk. Instead of storing one key and having two children, B-tree nodes ...
  6. [6]
    B-trees
    B-trees are a way to get better locality by putting multiple elements into each tree node. B-trees were originally invented for storing data structures on disk.
  7. [7]
    [PDF] Data Structures & Algorithms Lecture 15: B-Trees - Washington
    B+-Trees are multi-way search trees commonly used in database systems or other applications where data is stored externally on disks and keeping the tree ...
  8. [8]
    The Art of Computer Programming (TAOCP)
    Volume 3. Sorting and Searching , Second Edition (Reading, Massachusetts: Addison-Wesley, 1998), xiv+780pp.+foldout.
  9. [9]
    [PDF] Lecture 15 Binary Search Trees - Carnegie Mellon University
    This ordering invariant is a core idea of binary search trees; it's what makes a binary tree into a binary search tree. Ordering Invariant. At any node with ...
  10. [10]
    [PDF] CSE 373: B-trees - Washington
    Jan 31, 2018 · B-tree order invariant. For any given key k, all subtrees to the left may only contain keys x that satisfy x < k. All subtrees to the right ...
  11. [11]
    [PDF] Binary Search Trees - MIT
    If we allowed duplicate keys, we wouldn't be able to distinguish between multiple nodes possessing the same key. • Thus, in this implementation, duplicate keys ...
  12. [12]
    Binary Trees - andrew.cmu.ed
    Searching in a BST has O(h) worst-case runtime complexity, where h is the height of the tree. Since s binary search tree with n nodes has a minimum of O(log n) ...
  13. [13]
    Basic Algorithms: Lecture #3 - NYU Computer Science
    Proof: We write NN(h) to mean the number of nodes in a complete binary tree of height h. ... Hence NN(h)=NN(h-1)+2h-1 = (2h-1-1)+2h-1 = 2(2h-1)-1=2h-1 ...
  14. [14]
    [PDF] 6.006 Lecture 05: Binary search trees, BST sort
    Properties. Each node ... Balanced BSTs to the rescue in the next lecture! 7 . Page 8. MIT OpenCourseWare http://ocw.mit.edu. 6.006 Introduction to Algorithms.
  15. [15]
    Introduction to Algorithms - MIT Press
    $$150.00This fourth edition has been updated throughout, with new chapters on matchings in bipartite graphs, online algorithms, and machine learning, and new material ...
  16. [16]
    8.4 Introduction to Binary Search Trees — CSC148 Course Notes
    A binary tree is a binary search tree if every item in the tree satisfies the binary search tree property (the “every” is important: in general, it's possible ...
  17. [17]
    Organization and maintenance of large ordered indices
    Experiments have been performed with indices up to 100,000 keys. An index of size 15,000 (100,000) can be maintained with an average of 9 (at least 4) ...
  18. [18]
    [PDF] B-Trees
    Oct 28, 2015 · A B-tree is a balanced tree designed to be stored on a disk. Disks can only read and write (large) fixed-size blocks of data at once.<|control11|><|separator|>
  19. [19]
    17.6.2.2 The Physical Structure of an InnoDB Index
    InnoDB indexes are B-tree data structures. Spatial indexes use R-trees, which are specialized data structures for indexing multi-dimensional data.Missing: variant | Show results with:variant
  20. [20]
    [PDF] A new data structure for representing sorted lists - MPI-INF
    Insertion and deletion into (a,b)-trees is quite similar to the corresponding operations in B-trees. An insertion means the addition of a new leaf at a given.
  21. [21]
    [PDF] Dr. Dobb's | Ternary Search Trees | April 01, 1998 - Robert Sedgewick
    Apr 1, 1998 · In this article, we'll concentrate on what the data structure offers working programmers. Algorithms in C, Third Edition, by Robert Sedgewick ( ...Missing: introduction | Show results with:introduction
  22. [22]
    [PDF] Scapegoat Trees - People | MIT CSAIL
    2 Notations. In this section we describe the data structure of a scapegoat tree. Basically, a scapegoat tree consists of an ordinary binary search tree, with ...
  23. [23]
    Binary Search Tree Insertion
    The find or lookup operation can be coded either iteratively or recursively. Pseudocode for an iterative version of this algorithm is shown below.
  24. [24]
    [PDF] CMSC 420: Lecture 4 Binary Search Trees - UMD Computer Science
    Recursive Binary Tree Search. Value find(Key x, BSTNode p) { if (p == null) ... The pseudocode is presented in the code block below. The initial call is ...
  25. [25]
    [PDF] 1 Binary search trees
    A binary search tree is a data structure composed of nodes. Each node has a key, which determines the node's position in the tree.
  26. [26]
    Binary Search Trees - cs.wisc.edu
    Note: if duplicate keys are allowed, then nodes with values that are equal to the key in node n can be either in n's left subtree or in its right subtree (but ...
  27. [27]
    None
    Below is a merged summary of Binary Search Trees (Section 12.3) and B-Trees (Chapter 18) from *Introduction to Algorithms* by Cormen et al. (CLRS), consolidating all information from the provided summaries into a concise yet comprehensive response. To handle the dense and detailed nature of the content, I will use tables in CSV format where appropriate to organize pseudocode, descriptions, and key details efficiently. The response retains all unique information while avoiding redundancy.
  28. [28]
    [PDF] Organization and Maintenance of Large Ordered Indices
    In more illustrative terms theoretical analysis and actual experi- ments show that it is possible to maintain an index of size 15000 with an average of 9.
  29. [29]
    [PDF] An algorithm for the organization of information by GM Adel'son-Vel ...
    An algorithm for the organization of information by G. M. Adel'son-Vel'skii and E. M. Landis. Soviet Mathematics Doklady, 3, 1259-1263, 1962.
  30. [30]
    [PDF] A dichromatic framework for balanced trees - Robert Sedgewick
    In general, we shall consider families of trees which satisfy the following two conditions: 1. External nodes are black~ internal nodes may be red or black.
  31. [31]
    [PDF] Self-Adjusting Binary Search Trees
    The binary search tree is a data structure for representing tables and lists so that accessing, inserting, and deleting items is easy. On an n-node splay tree, ...
  32. [32]
    TreeMap (Java Platform SE 8 ) - Oracle Help Center
    TreeMap is a Red-Black tree based NavigableMap implementation, sorted by natural key ordering or a Comparator, with log(n) time for key operations.
  33. [33]
    [PDF] NTFS Documentation
    NTFS is the filesystem of Windows NT, 2000 and XP. It supports almost all POSIX features, all HFS features, and all HPFS features. • It can deal ...
  34. [34]
    Autocomplete | CSE 373 - Washington
    During class, we compared the ternary search tree data structure to the trie data structure. Like a TST, a trie can also be used to implement the Autocomplete ...
  35. [35]
    Red Black Tree vs AVL Tree - GeeksforGeeks
    Jul 11, 2025 · Red Black Trees provide faster insertion and removal operations than AVL trees as fewer rotations are done due to relatively relaxed balancing.
  36. [36]
    Red-black Trees (rbtree) in Linux — The Linux Kernel documentation
    Red-black trees are a type of self-balancing binary search tree, used for storing sortable key/value data pairs. This differs from radix trees ...
  37. [37]
    B-tree vs. Binary Search Tree | Attractive Chaos - WordPress.com
    Sep 24, 2008 · People have done a lot of comparisons between AVL tree and red-black tree. My impression is they have quite similar practical performance. And ...
  38. [38]
  39. [39]
    [PDF] PERFORMANCE COMPARISON OF B-TREE INDEXING IN ...
    Jun 23, 2025 · This thesis presents a performance comparison of B-tree indexing for the rela- tional database PostgreSQL and the NoSQL database MongoDB.