Skip to main content

Menu

LEVEL 0
0/5 XP
HomeAboutTopicsPricingMy VaultStats

Categories

🤖 Artificial Intelligence
☁️ Cloud and Infrastructure
💾 Data and Databases
💼 Professional Skills
🎯 Programming and Development
🔒 Security and Networking
📚 Specialized Topics
HomeAboutTopicsPricingMy VaultStats
LEVEL 0
0/5 XP
GitHub
© 2026 CheatGrid™. All rights reserved.
Privacy PolicyTerms of UseAboutContact

Trees & Binary Search Trees Cheat Sheet

Trees & Binary Search Trees Cheat Sheet

Back to Software Engineering
Updated 2026-04-29
Next Topic: Twelve-Factor App Methodology Cheat Sheet

Trees and Binary Search Trees are hierarchical data structures fundamental to computer science, storing data in parent-child relationships rather than linear sequences. While a binary tree simply restricts each node to at most two children, a Binary Search Tree (BST) imposes an ordering constraint — left children hold smaller values, right children hold larger values — enabling logarithmic-time operations when balanced. Understanding traversal patterns, balancing mechanisms, and structural properties is essential for efficient searching, sorting, and hierarchical data manipulation across countless algorithms and applications.

What This Cheat Sheet Covers

This topic spans 15 focused tables and 105 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.

Table 1: Core Tree TerminologyTable 2: Binary Tree TypesTable 3: Binary Search Tree (BST) FundamentalsTable 4: BST Core OperationsTable 5: Tree Traversal MethodsTable 6: Depth-First vs Breadth-First SearchTable 7: Advanced Traversal PatternsTable 8: Self-Balancing BST TypesTable 9: AVL Tree RotationsTable 10: Specialized Tree StructuresTable 11: Common Tree AlgorithmsTable 12: BST Complexity AnalysisTable 13: Advanced BST OperationsTable 14: Tree Properties and FormulasTable 15: Tree Problem-Solving Patterns

Table 1: Core Tree Terminology

TermExampleDescription
Root
root = TreeNode(10)
• The topmost node with no parent
• serves as the single entry point for all tree operations.
Leaf (External Node)
node.left == None and node.right == None
• A node with no children
• appears at the tree's periphery and marks endpoints in traversals.
Internal Node
Any node with at least one child
• A node with one or two children
• forms the structural backbone connecting root to leaves.
Height
height = max(left_height, right_height) + 1
• Number of edges on the longest path from a node to any descendant leaf
• the root's height equals the tree's height.
Depth
Depth of root is 0
• Number of edges from the root to a specific node
• increases by 1 at each level downward.
Level
Root is at level 0
• The set of all nodes at the same depth
• level-order traversals process one level at a time.
Edge
Connection between parent and child
• The link between two nodes representing a parent-child relationship
• a tree with n nodes has exactly n-1 edges.

More in Software Engineering

  • Testing in Python Cheat Sheet
  • Twelve-Factor App Methodology Cheat Sheet
  • _Dependency_Injection_Patterns
  • Database Migration Strategies for Development Teams Cheat Sheet
  • Integration Testing Patterns and Strategies Cheat Sheet
  • Software Architecture Fitness Functions Cheat Sheet
View all 47 topics in Software Engineering