DSAWiser

DSA question set · 200 questions

Binary Search Tree DSA Practice Questions

Explore 200 DSA questions in Binary Search Tree. Practice with DSAWiser’s code editor and visualizer.

BST fundamentals / small drillsCreate a Single-Node BSTCheck Left Child BST InvariantCheck Right Child BST InvariantDetermine Next Search DirectionInsert Second Node into BSTValidate 3-Node Local BST PropertyFind Minimum in a 3-Node BSTFind Maximum in a 3-Node BSTInorder Traversal of a 3-Node BSTCheck if 3-Node Tree Inorder is Strictly SortedInorder Predecessor of Root in a 3-Node BSTInorder Successor of Root in a 3-Node BSTDetect Duplicate Value Violation at RootTarget Search in a 3-Node BSTSearch Comparison Count in a 3-Node BSTMinimum in a Left-Skewed 2-Node BSTMaximum in a Left-Skewed 2-Node BSTMinimum in a Right-Skewed 2-Node BSTMaximum in a Right-Skewed 2-Node BSTCheck if Root is in Range [Low, High]Minimum in a 3-Node Left ChainMaximum in a 3-Node Right ChainCount Elements Smaller than Root in a 3-Node BSTCount Elements Greater than Root in a 3-Node BSTCheck Invariant along a 3-Node Left ChainCheck Invariant along a 3-Node Right ChainInsert Smaller Node into Left-Skewed 2-Node BSTInsert Larger Node into Right-Skewed 2-Node BSTSubtree Pruning Decision for Range QueryPositive Difference with Left ChildPositive Difference with Right ChildPlacement Decision for New ValueInorder Successor of Left Child in 3-Node BSTInorder Predecessor of Right Child in 3-Node BSTCheck Sibling Ordering in BSTConstruct Balanced 3-Node BST from Sorted TripleValid Root Choice for 3 Distinct NumbersLowest Common Ancestor in a 3-Node BSTDelete Minimum in a 3-Node BSTDelete Maximum in a 3-Node BSTDetect Insertion Duplicate ConflictSuccessor Replacement Deletion in 3-Node BSTPredecessor Replacement Deletion in 3-Node BSTPartition of Real Line by BST RootInorder Array after Inserting into 1-Node BSTFind Minimum in Any 3-Node BST ShapeFind Maximum in Any 3-Node BST ShapeSearch Failure Comparison in 1-Node BSTValidate 3-Node Combination of Valid 1-Node SubtreesCheck if Two 2-Node BSTs are IdenticalBST search / traversalSearch in a Binary Search TreeMinimum Element in BSTMaximum Element in BSTRange Sum of BSTLowest Common Ancestor of a BSTTwo Sum IV - Input is a BSTMinimum Absolute Difference in BSTFind Mode in Binary Search TreeFloor in a Binary Search TreeCeiling in a Binary Search TreeInorder Successor in BSTInorder Predecessor in BSTKth Largest Element in a BSTCheck if Array Represents Inorder Traversal of BSTCount Nodes in BST within RangeSecond Largest Element in BSTClosest Value in a Binary Search TreeSum of Elements Smaller than K in BSTSum of Elements Greater than K in BSTCheck if Two BSTs Contain Identical ElementsInsert into a Binary Search Tree (Leaf Node)Absolute Difference Between BST Minimum and MaximumAll Elements in Two Binary Search TreesSearch Path Length in BSTFind Pair with Target Difference in BSTSmallest Node in Right SubtreeLargest Node in Left SubtreeDistance Between Two Nodes in a BSTPrint BST Keys in Descending OrderCheck if Triplet Can Form a BST PreorderBinary-tree supportCount Single-Child Nodes in a BSTSorted Leaf Values of a BSTPath from Root to Target in BSTSmallest Missing Positive Integer in BSTCheck if Root is Average of Children in BSTStrict Upper Bound in BSTStrict Lower Bound in BSTCount Nodes with Both Children in BSTFind Median of a BSTCheck if BST is SkewedHeight of a Binary Search TreeTotal Node Count in BSTRange Sum of BST LeavesTarget Feasibility Check via BST BoundariesIncreasing Order Search TreeConvert Sorted Array to Balanced BSTValidate Binary Search Tree via Inorder CheckConvert BST to Greater Sum TreeCount Subtrees Fully Contained in Range [Low, High]Check if BST is Height-BalancedBST algorithms / mutationDelete Node in a BSTTrim a Binary Search TreeKth Smallest Element in a BSTBinary Search Tree IteratorValidate BST with Range BoundsConstruct Binary Search Tree from Preorder TraversalBST combinatorics / DPUnique Binary Search Trees (Count)Unique Binary Search Trees II (Generate)Recover Binary Search TreeBalance a Binary Search TreeConvert Sorted List to Binary Search TreeSerialize and Deserialize a Strict BSTInorder Successor in BST II (with Parent Pointers)Verify Preorder Sequence in Binary Search TreeSplit BSTConvert Binary Search Tree to Sorted Doubly Linked ListTwo Sum in Two BSTsClosest Binary Search Tree Value IIConstruct Binary Search Tree from Postorder TraversalInorder Predecessor in BST with Parent PointersVerify Postorder Sequence of Binary Search TreeConvert BST to Min-HeapMinimum Swaps to Convert Binary Tree to BSTCheck if Each Internal Node of BST Has Exactly One Child from PreorderCount Pairs from Two BSTs Whose Sum Equals TargetMerge Two BSTs into a Sorted List with Minimal SpaceInorder Predecessor and Successor for Any Key in BSTOrdered-set applicationsReplace Every Element with the Least Greater Element on Its RightLargest BST Subtree in a Binary TreeCheck if Two Arrays Represent the Same BST Without Building TreesShortest Distance Between Two Nodes in a BSTRank from Stream Using Augmented BSTConstruct BST from Level Order Traversal in O(n) TimeFind if a Triplet with Sum Zero Exists in a BSTMerge Two BSTs into a Single Balanced BSTCount Subtrees with All Values in RangeNumber of Unique BSTs with Target HeightCheck if BST Contains a Dead EndPopulate Inorder Successor Pointers in a BSTTwo Sum in a BST with O(h) Space via Dual IteratorsImplement AVL Rotations on a BST NodeClosest Leaf Node to a Target Key in BSTCheck if Array Represents Level Order Traversal of BSTConvert BST to Smaller Sum TreeInversion Count via Augmented BSTOptimal Binary Search Tree Expected Search CostAdvanced BST implementationsRecover BST with Arbitrary Misplaced NodesConstruct Treap / Cartesian Tree from Sorted Inorder Keys in O(n) TimeBST theory / balancingStatic ordered index / finger searchWeight balance / rebuildingOptimization DPPartition DP / segment maximumWilber's First Alternative Lower Bound on BST Access SequencesFind Median of BST in O(1) Extra SpaceDay-Stout-Warren (DSW) In-Place Tree BalancingConvert BST to Greater Sum Tree in O(1) SpaceK Pairs with Smallest Absolute Difference Between Two BSTsMaximum Sum BST in Binary TreeOrdered-set / interval applicationsCount of Smaller Numbers After Self via Augmented BSTData Stream as Disjoint Intervals Using Balanced BSTSelf-Balancing AVL Tree ImplementationReverse Pairs Using Augmented BSTMy Calendar III (K-Booking via Dynamic BST)Splay Tree ImplementationCount of Range Sum via Augmented Self-Balancing BSTTreap Split and Merge PrimitivesRange Module Using Balanced Interval BSTNumber of Ways to Reorder Array to Get Same BSTPersistent Binary Search Tree with Path CopyingFalling Squares via Dynamic Coordinate Interval BSTRed-Black Tree Insertion with Recoloring and RestructuringImplicit sequence treesImplicit Treap with Range Reversal via Lazy PropagationDynamic Running Median with Arbitrary DeletionsSmallest Range Covering Elements from K Lists via Balanced BSTMerge K BSTs into a Balanced BST with Streaming IteratorsScapegoat Tree with Dynamic Subtree RebuildingRecover BST with Two Swapped Disjoint SubtreesKnuth's Optimal BST in O(n^2) TimePersistent Treap with Pure Functional Split and MergeThe Skyline Problem via Balanced BST Contour TrackingRed-Black Tree Deletion with Double-Black ResolutionInterval Tree for Fast Overlap Queries via Augmented BSTMaximum Subarray Sum in Dynamic Range via Implicit TreapTreap with Range Affine Transformations and Range SumsComputational geometryDynamic Upper Convex Hull Maintenance via Slope-Ordered BSTGeometry / range structures2D range trees / coordinate compressionStrings / sequence treesRope Data Structure via Implicit TreapDynamic/general treesIncremental Minimum Spanning Forest via Link-Cut TreeSuffix BST / exact LCPL1 isotonic regression / slope trickHeavy-Light Tree Decomposition with Path Splay TreesLink-Cut Tree: Dynamic Forest Path Aggregates via Splay TreesKinetic Ordered Tree with Adjacent Crossing EventsPersistent Convex Hull Trick with Slope Trick via Persistent TreapEuler Tour Tree via Implicit Treap for Dynamic Graph ConnectivityTango Tree: O(log log n) Competitive Binary Search TreeStatic range reporting / fractional cascadingTop Tree: Dynamic Forest Path and Subtree MaintenanceOvermars-van Leeuwen Fully Dynamic Convex HullPlanar Point Location with a Persistent Sweep BSTCartesian-tree pattern matchingCartesian Tree Isomorphism and Signature Matching

What’s in this set

The Binary Search Tree collection contains 200 problems: 50 basic, 44 easy, 58 medium, 38 hard, 10 very hard. Choose a question at your current level, or follow the collection’s order below.

Topics in this collection include BST fundamentals / small drills, Create a Single-Node BST, Check Left Child BST Invariant, Check Right Child BST Invariant, Determine Next Search Direction. Each question shows its own topics and difficulty so you can decide where to begin.

Practice with the code visualizer

  1. Open a question in the editor and read the statement, inputs, and expected output. Predict the result for a small example before writing code.
  2. Write a solution and run the examples. If a result differs from your prediction, reduce the input until you can follow each step.
  3. Step through your code in the visualizer. Use a breakpoint to inspect the state at a specific line, then compare it with your reasoning.

Questions in this set

200 total

Open a question in the editor to read its statement and examples. Sign in to practice.

  1. Create a Single-Node BSTBST fundamentals / small drills · Create a Single-Node BSTBasic
  2. Check Left Child BST InvariantBST fundamentals / small drills · Check Left Child BST InvariantBasic
  3. Check Right Child BST InvariantBST fundamentals / small drills · Check Right Child BST InvariantBasic
  4. Determine Next Search DirectionBST fundamentals / small drills · Determine Next Search DirectionBasic
  5. Insert Second Node into BSTBST fundamentals / small drills · Insert Second Node into BSTBasic
  6. Validate 3-Node Local BST PropertyBST fundamentals / small drills · Validate 3-Node Local BST PropertyBasic
  7. Find Minimum in a 3-Node BSTBST fundamentals / small drills · Find Minimum in a 3-Node BSTBasic
  8. Find Maximum in a 3-Node BSTBST fundamentals / small drills · Find Maximum in a 3-Node BSTBasic
  9. Inorder Traversal of a 3-Node BSTBST fundamentals / small drills · Inorder Traversal of a 3-Node BSTBasic
  10. Check if 3-Node Tree Inorder is Strictly SortedBST fundamentals / small drills · Check if 3-Node Tree Inorder is Strictly SortedBasic
  11. Inorder Predecessor of Root in a 3-Node BSTBST fundamentals / small drills · Inorder Predecessor of Root in a 3-Node BSTBasic
  12. Inorder Successor of Root in a 3-Node BSTBST fundamentals / small drills · Inorder Successor of Root in a 3-Node BSTBasic
  13. Detect Duplicate Value Violation at RootBST fundamentals / small drills · Detect Duplicate Value Violation at RootBasic
  14. Target Search in a 3-Node BSTBST fundamentals / small drills · Target Search in a 3-Node BSTBasic
  15. Search Comparison Count in a 3-Node BSTBST fundamentals / small drills · Search Comparison Count in a 3-Node BSTBasic
  16. Minimum in a Left-Skewed 2-Node BSTBST fundamentals / small drills · Minimum in a Left-Skewed 2-Node BSTBasic
  17. Maximum in a Left-Skewed 2-Node BSTBST fundamentals / small drills · Maximum in a Left-Skewed 2-Node BSTBasic
  18. Minimum in a Right-Skewed 2-Node BSTBST fundamentals / small drills · Minimum in a Right-Skewed 2-Node BSTBasic
  19. Maximum in a Right-Skewed 2-Node BSTBST fundamentals / small drills · Maximum in a Right-Skewed 2-Node BSTBasic
  20. Check if Root is in Range [Low, High]BST fundamentals / small drills · Check if Root is in Range [Low, High]Basic
  21. Minimum in a 3-Node Left ChainBST fundamentals / small drills · Minimum in a 3-Node Left ChainBasic
  22. Maximum in a 3-Node Right ChainBST fundamentals / small drills · Maximum in a 3-Node Right ChainBasic
  23. Count Elements Smaller than Root in a 3-Node BSTBST fundamentals / small drills · Count Elements Smaller than Root in a 3-Node BSTBasic
  24. Count Elements Greater than Root in a 3-Node BSTBST fundamentals / small drills · Count Elements Greater than Root in a 3-Node BSTBasic
  25. Check Invariant along a 3-Node Left ChainBST fundamentals / small drills · Check Invariant along a 3-Node Left ChainBasic
  26. Check Invariant along a 3-Node Right ChainBST fundamentals / small drills · Check Invariant along a 3-Node Right ChainBasic
  27. Insert Smaller Node into Left-Skewed 2-Node BSTBST fundamentals / small drills · Insert Smaller Node into Left-Skewed 2-Node BSTBasic
  28. Insert Larger Node into Right-Skewed 2-Node BSTBST fundamentals / small drills · Insert Larger Node into Right-Skewed 2-Node BSTBasic
  29. Subtree Pruning Decision for Range QueryBST fundamentals / small drills · Subtree Pruning Decision for Range QueryBasic
  30. Positive Difference with Left ChildBST fundamentals / small drills · Positive Difference with Left ChildBasic
  31. Positive Difference with Right ChildBST fundamentals / small drills · Positive Difference with Right ChildBasic
  32. Placement Decision for New ValueBST fundamentals / small drills · Placement Decision for New ValueBasic
  33. Inorder Successor of Left Child in 3-Node BSTBST fundamentals / small drills · Inorder Successor of Left Child in 3-Node BSTBasic
  34. Inorder Predecessor of Right Child in 3-Node BSTBST fundamentals / small drills · Inorder Predecessor of Right Child in 3-Node BSTBasic
  35. Check Sibling Ordering in BSTBST fundamentals / small drills · Check Sibling Ordering in BSTBasic
  36. Construct Balanced 3-Node BST from Sorted TripleBST fundamentals / small drills · Construct Balanced 3-Node BST from Sorted TripleBasic
  37. Valid Root Choice for 3 Distinct NumbersBST fundamentals / small drills · Valid Root Choice for 3 Distinct NumbersBasic
  38. Lowest Common Ancestor in a 3-Node BSTBST fundamentals / small drills · Lowest Common Ancestor in a 3-Node BSTBasic
  39. Delete Minimum in a 3-Node BSTBST fundamentals / small drills · Delete Minimum in a 3-Node BSTBasic
  40. Delete Maximum in a 3-Node BSTBST fundamentals / small drills · Delete Maximum in a 3-Node BSTBasic
  41. Detect Insertion Duplicate ConflictBST fundamentals / small drills · Detect Insertion Duplicate ConflictBasic
  42. Successor Replacement Deletion in 3-Node BSTBST fundamentals / small drills · Successor Replacement Deletion in 3-Node BSTBasic
  43. Predecessor Replacement Deletion in 3-Node BSTBST fundamentals / small drills · Predecessor Replacement Deletion in 3-Node BSTBasic
  44. Partition of Real Line by BST RootBST fundamentals / small drills · Partition of Real Line by BST RootBasic
  45. Inorder Array after Inserting into 1-Node BSTBST fundamentals / small drills · Inorder Array after Inserting into 1-Node BSTBasic
  46. Find Minimum in Any 3-Node BST ShapeBST fundamentals / small drills · Find Minimum in Any 3-Node BST ShapeBasic
  47. Find Maximum in Any 3-Node BST ShapeBST fundamentals / small drills · Find Maximum in Any 3-Node BST ShapeBasic
  48. Search Failure Comparison in 1-Node BSTBST fundamentals / small drills · Search Failure Comparison in 1-Node BSTBasic
  49. Validate 3-Node Combination of Valid 1-Node SubtreesBST fundamentals / small drills · Validate 3-Node Combination of Valid 1-Node SubtreesBasic
  50. Check if Two 2-Node BSTs are IdenticalBST fundamentals / small drills · Check if Two 2-Node BSTs are IdenticalBasic
  51. Search in a Binary Search TreeBST search / traversal · Search in a Binary Search TreeEasy
  52. Minimum Element in BSTBST search / traversal · Minimum Element in BSTEasy
  53. Maximum Element in BSTBST search / traversal · Maximum Element in BSTEasy
  54. Range Sum of BSTBST search / traversal · Range Sum of BSTEasy
  55. Lowest Common Ancestor of a BSTBST search / traversal · Lowest Common Ancestor of a BSTEasy
  56. Two Sum IV - Input is a BSTBST search / traversal · Two Sum IV - Input is a BSTEasy
  57. Minimum Absolute Difference in BSTBST search / traversal · Minimum Absolute Difference in BSTEasy
  58. Find Mode in Binary Search TreeBST search / traversal · Find Mode in Binary Search TreeEasy
  59. Floor in a Binary Search TreeBST search / traversal · Floor in a Binary Search TreeEasy
  60. Ceiling in a Binary Search TreeBST search / traversal · Ceiling in a Binary Search TreeEasy
  61. Inorder Successor in BSTBST search / traversal · Inorder Successor in BSTEasy
  62. Inorder Predecessor in BSTBST search / traversal · Inorder Predecessor in BSTEasy
  63. Kth Largest Element in a BSTBST search / traversal · Kth Largest Element in a BSTEasy
  64. Check if Array Represents Inorder Traversal of BSTBST search / traversal · Check if Array Represents Inorder Traversal of BSTEasy
  65. Count Nodes in BST within RangeBST search / traversal · Count Nodes in BST within RangeEasy
  66. Second Largest Element in BSTBST search / traversal · Second Largest Element in BSTEasy
  67. Closest Value in a Binary Search TreeBST search / traversal · Closest Value in a Binary Search TreeEasy
  68. Sum of Elements Smaller than K in BSTBST search / traversal · Sum of Elements Smaller than K in BSTEasy
  69. Sum of Elements Greater than K in BSTBST search / traversal · Sum of Elements Greater than K in BSTEasy
  70. Check if Two BSTs Contain Identical ElementsBST search / traversal · Check if Two BSTs Contain Identical ElementsEasy
  71. Insert into a Binary Search Tree (Leaf Node)BST search / traversal · Insert into a Binary Search Tree (Leaf Node)Easy
  72. Absolute Difference Between BST Minimum and MaximumBST search / traversal · Absolute Difference Between BST Minimum and MaximumEasy
  73. All Elements in Two Binary Search TreesBST search / traversal · All Elements in Two Binary Search TreesEasy
  74. Search Path Length in BSTBST search / traversal · Search Path Length in BSTEasy
  75. Find Pair with Target Difference in BSTBST search / traversal · Find Pair with Target Difference in BSTEasy
  76. Smallest Node in Right SubtreeBST search / traversal · Smallest Node in Right SubtreeEasy
  77. Largest Node in Left SubtreeBST search / traversal · Largest Node in Left SubtreeEasy
  78. Distance Between Two Nodes in a BSTBST search / traversal · Distance Between Two Nodes in a BSTEasy
  79. Print BST Keys in Descending OrderBST search / traversal · Print BST Keys in Descending OrderEasy
  80. Check if Triplet Can Form a BST PreorderBST search / traversal · Check if Triplet Can Form a BST PreorderEasy
  81. Count Single-Child Nodes in a BSTBinary-tree support · Count Single-Child Nodes in a BSTEasy
  82. Sorted Leaf Values of a BSTBinary-tree support · Sorted Leaf Values of a BSTEasy
  83. Path from Root to Target in BSTBST search / traversal · Path from Root to Target in BSTEasy
  84. Smallest Missing Positive Integer in BSTBST search / traversal · Smallest Missing Positive Integer in BSTEasy
  85. Check if Root is Average of Children in BSTBinary-tree support · Check if Root is Average of Children in BSTEasy
  86. Strict Upper Bound in BSTBST search / traversal · Strict Upper Bound in BSTEasy
  87. Strict Lower Bound in BSTBST search / traversal · Strict Lower Bound in BSTEasy
  88. Count Nodes with Both Children in BSTBinary-tree support · Count Nodes with Both Children in BSTEasy
  89. Find Median of a BSTBST search / traversal · Find Median of a BSTEasy
  90. Check if BST is SkewedBinary-tree support · Check if BST is SkewedEasy
  91. Height of a Binary Search TreeBinary-tree support · Height of a Binary Search TreeEasy
  92. Total Node Count in BSTBinary-tree support · Total Node Count in BSTEasy
  93. Range Sum of BST LeavesBST search / traversal · Range Sum of BST LeavesEasy
  94. Target Feasibility Check via BST BoundariesBST search / traversal · Target Feasibility Check via BST BoundariesEasy
  95. Increasing Order Search TreeBST search / traversal · Increasing Order Search TreeMedium
  96. Convert Sorted Array to Balanced BSTBST search / traversal · Convert Sorted Array to Balanced BSTMedium
  97. Validate Binary Search Tree via Inorder CheckBST search / traversal · Validate Binary Search Tree via Inorder CheckMedium
  98. Convert BST to Greater Sum TreeBST search / traversal · Convert BST to Greater Sum TreeMedium
  99. Count Subtrees Fully Contained in Range [Low, High]BST search / traversal · Count Subtrees Fully Contained in Range [Low, High]Medium
  100. Check if BST is Height-BalancedBinary-tree support · Check if BST is Height-BalancedMedium
  101. Delete Node in a BSTBST algorithms / mutation · Delete Node in a BSTMedium
  102. Trim a Binary Search TreeBST algorithms / mutation · Trim a Binary Search TreeMedium
  103. Kth Smallest Element in a BSTBST algorithms / mutation · Kth Smallest Element in a BSTMedium
  104. Binary Search Tree IteratorBST algorithms / mutation · Binary Search Tree IteratorMedium
  105. Validate BST with Range BoundsBST algorithms / mutation · Validate BST with Range BoundsMedium
  106. Construct Binary Search Tree from Preorder TraversalBST algorithms / mutation · Construct Binary Search Tree from Preorder TraversalMedium
  107. Unique Binary Search Trees (Count)BST combinatorics / DP · Unique Binary Search Trees (Count)Medium
  108. Unique Binary Search Trees II (Generate)BST combinatorics / DP · Unique Binary Search Trees II (Generate)Medium
  109. Recover Binary Search TreeBST algorithms / mutation · Recover Binary Search TreeMedium
  110. Balance a Binary Search TreeBST algorithms / mutation · Balance a Binary Search TreeMedium
  111. Convert Sorted List to Binary Search TreeBST algorithms / mutation · Convert Sorted List to Binary Search TreeMedium
  112. Serialize and Deserialize a Strict BSTBST algorithms / mutation · Serialize and Deserialize a Strict BSTMedium
  113. Inorder Successor with Parent-Link ConstructionBST algorithms / mutation · Inorder Successor in BST II (with Parent Pointers)Medium
  114. Verify Preorder Sequence in Binary Search TreeBST algorithms / mutation · Verify Preorder Sequence in Binary Search TreeMedium
  115. Split BSTBST algorithms / mutation · Split BSTMedium
  116. BST to Circular Doubly Linked List RecordsBST algorithms / mutation · Convert Binary Search Tree to Sorted Doubly Linked ListMedium
  117. Two Sum in Two BSTsBST algorithms / mutation · Two Sum in Two BSTsMedium
  118. Closest Binary Search Tree Value IIBST algorithms / mutation · Closest Binary Search Tree Value IIMedium
  119. Construct Binary Search Tree from Postorder TraversalBST algorithms / mutation · Construct Binary Search Tree from Postorder TraversalMedium
  120. Inorder Predecessor with Parent-Link ConstructionBST algorithms / mutation · Inorder Predecessor in BST with Parent PointersMedium
  121. Verify Postorder Sequence of Binary Search TreeBST algorithms / mutation · Verify Postorder Sequence of Binary Search TreeMedium
  122. Convert BST to Min-HeapBST algorithms / mutation · Convert BST to Min-HeapMedium
  123. Minimum Swaps to Convert Binary Tree to BSTBST algorithms / mutation · Minimum Swaps to Convert Binary Tree to BSTMedium
  124. Check if Each Internal Node of BST Has Exactly One Child from PreorderBST algorithms / mutation · Check if Each Internal Node of BST Has Exactly One Child from PreorderMedium
  125. Count Pairs from Two BSTs Whose Sum Equals TargetBST algorithms / mutation · Count Pairs from Two BSTs Whose Sum Equals TargetMedium
  126. Merge Two BSTs into a Sorted List with Minimal SpaceBST algorithms / mutation · Merge Two BSTs into a Sorted List with Minimal SpaceMedium
  127. Inorder Predecessor and Successor for Any Key in BSTBST algorithms / mutation · Inorder Predecessor and Successor for Any Key in BSTMedium
  128. Replace Every Element with the Least Greater Element on Its RightOrdered-set applications · Replace Every Element with the Least Greater Element on Its RightMedium
  129. Largest BST Subtree in a Binary TreeBST algorithms / mutation · Largest BST Subtree in a Binary TreeMedium
  130. Check if Two Arrays Represent the Same BST Without Building TreesBST algorithms / mutation · Check if Two Arrays Represent the Same BST Without Building TreesMedium
  131. Shortest Distance Between Two Nodes in a BSTBST algorithms / mutation · Shortest Distance Between Two Nodes in a BSTMedium
  132. Rank from Stream Using Augmented BSTOrdered-set applications · Rank from Stream Using Augmented BSTMedium
  133. Construct BST from Level Order Traversal in O(n) TimeBST algorithms / mutation · Construct BST from Level Order Traversal in O(n) TimeMedium
  134. Find if a Triplet with Sum Zero Exists in a BSTBST algorithms / mutation · Find if a Triplet with Sum Zero Exists in a BSTMedium
  135. Merge Two BSTs into a Single Balanced BSTBST algorithms / mutation · Merge Two BSTs into a Single Balanced BSTMedium
  136. Count Subtrees with All Values in RangeBST algorithms / mutation · Count Subtrees with All Values in RangeMedium
  137. Number of Unique BSTs with Target HeightBST combinatorics / DP · Number of Unique BSTs with Target HeightMedium
  138. Check if BST Contains a Dead EndBST algorithms / mutation · Check if BST Contains a Dead EndMedium
  139. Inorder Successor Link Records in a BSTBST algorithms / mutation · Populate Inorder Successor Pointers in a BSTMedium
  140. Two Sum in a BST with O(h) Space via Dual IteratorsBST algorithms / mutation · Two Sum in a BST with O(h) Space via Dual IteratorsMedium
  141. Implement AVL Rotations on a BST NodeBST algorithms / mutation · Implement AVL Rotations on a BST NodeMedium
  142. Closest Leaf Node to a Target Key in BSTBST algorithms / mutation · Closest Leaf Node to a Target Key in BSTMedium
  143. Check if Array Represents Level Order Traversal of BSTBST algorithms / mutation · Check if Array Represents Level Order Traversal of BSTMedium
  144. Convert BST to Smaller Sum TreeBST algorithms / mutation · Convert BST to Smaller Sum TreeMedium
  145. Inversion Count via Augmented BSTOrdered-set applications · Inversion Count via Augmented BSTMedium
  146. Optimal Binary Search Tree Expected Search CostBST combinatorics / DP · Optimal Binary Search Tree Expected Search CostMedium
  147. Recover BST with Arbitrary Misplaced NodesAdvanced BST implementations · Recover BST with Arbitrary Misplaced NodesMedium
  148. Construct Treap / Cartesian Tree from Sorted Inorder Keys in O(n) TimeAdvanced BST implementations · Construct Treap / Cartesian Tree from Sorted Inorder Keys in O(n) TimeMedium
  149. Finger Search in a BST with a Static Rank IndexBST theory / balancing · Static ordered index / finger searchMedium
  150. Maintain a Weight-Balanced BST by RebuildingBST theory / balancing · Weight balance / rebuildingMedium
  151. Partition DP with Segment Maximum and Quadratic Length CostOptimization DP · Partition DP / segment maximumMedium
  152. Wilber's First Alternative Lower Bound on BST Access SequencesBST theory / balancing · Wilber's First Alternative Lower Bound on BST Access SequencesMedium
  153. Find Median of BST in O(1) Extra SpaceBST algorithms / mutation · Find Median of BST in O(1) Extra SpaceHard
  154. Day-Stout-Warren (DSW) In-Place Tree BalancingBST algorithms / mutation · Day-Stout-Warren (DSW) In-Place Tree BalancingHard
  155. Convert BST to Greater Sum Tree in O(1) SpaceBST algorithms / mutation · Convert BST to Greater Sum Tree in O(1) SpaceHard
  156. K Pairs with Smallest Absolute Difference Between Two BSTsOrdered-set applications · K Pairs with Smallest Absolute Difference Between Two BSTsHard
  157. Maximum Sum BST in Binary TreeAdvanced BST implementations · Maximum Sum BST in Binary TreeHard
  158. Count of Smaller Numbers After Self via Augmented BSTOrdered-set / interval applications · Count of Smaller Numbers After Self via Augmented BSTHard
  159. Data Stream as Disjoint Intervals Using Balanced BSTOrdered-set / interval applications · Data Stream as Disjoint Intervals Using Balanced BSTHard
  160. Self-Balancing AVL Tree ImplementationAdvanced BST implementations · Self-Balancing AVL Tree ImplementationHard
  161. Reverse Pairs Using Augmented BSTOrdered-set / interval applications · Reverse Pairs Using Augmented BSTHard
  162. My Calendar III (K-Booking via Dynamic BST)Ordered-set / interval applications · My Calendar III (K-Booking via Dynamic BST)Hard
  163. Splay Tree ImplementationAdvanced BST implementations · Splay Tree ImplementationHard
  164. Count of Range Sum via Augmented Self-Balancing BSTOrdered-set / interval applications · Count of Range Sum via Augmented Self-Balancing BSTHard
  165. Treap Split and Merge PrimitivesAdvanced BST implementations · Treap Split and Merge PrimitivesHard
  166. Range Module Using Balanced Interval BSTOrdered-set / interval applications · Range Module Using Balanced Interval BSTHard
  167. Number of Ways to Reorder Array to Get Same BSTBST combinatorics / DP · Number of Ways to Reorder Array to Get Same BSTHard
  168. Persistent Binary Search Tree with Path CopyingAdvanced BST implementations · Persistent Binary Search Tree with Path CopyingHard
  169. Falling Squares via Dynamic Coordinate Interval BSTOrdered-set / interval applications · Falling Squares via Dynamic Coordinate Interval BSTHard
  170. Red-Black Tree Insertion with Recoloring and RestructuringAdvanced BST implementations · Red-Black Tree Insertion with Recoloring and RestructuringHard
  171. Implicit Treap with Range Reversal via Lazy PropagationImplicit sequence trees · Implicit Treap with Range Reversal via Lazy PropagationHard
  172. Dynamic Running Median with Arbitrary DeletionsOrdered-set / interval applications · Dynamic Running Median with Arbitrary DeletionsHard
  173. Smallest Range Covering Elements from K Lists via Balanced BSTOrdered-set / interval applications · Smallest Range Covering Elements from K Lists via Balanced BSTHard
  174. Merge K BSTs into a Balanced BST with Streaming IteratorsAdvanced BST implementations · Merge K BSTs into a Balanced BST with Streaming IteratorsHard
  175. Scapegoat Tree with Dynamic Subtree RebuildingAdvanced BST implementations · Scapegoat Tree with Dynamic Subtree RebuildingHard
  176. Recover BST with Two Swapped Disjoint SubtreesAdvanced BST implementations · Recover BST with Two Swapped Disjoint SubtreesHard
  177. Knuth's Optimal BST in O(n^2) TimeBST combinatorics / DP · Knuth's Optimal BST in O(n^2) TimeHard
  178. Persistent Treap with Pure Functional Split and MergeAdvanced BST implementations · Persistent Treap with Pure Functional Split and MergeHard
  179. The Skyline Problem via Balanced BST Contour TrackingOrdered-set / interval applications · The Skyline Problem via Balanced BST Contour TrackingHard
  180. Red-Black Tree Deletion with Double-Black ResolutionAdvanced BST implementations · Red-Black Tree Deletion with Double-Black ResolutionHard
  181. Interval Tree for Fast Overlap Queries via Augmented BSTOrdered-set / interval applications · Interval Tree for Fast Overlap Queries via Augmented BSTHard
  182. Maximum Subarray Sum in Dynamic Range via Implicit TreapImplicit sequence trees · Maximum Subarray Sum in Dynamic Range via Implicit TreapHard
  183. Treap with Range Affine Transformations and Range SumsImplicit sequence trees · Treap with Range Affine Transformations and Range SumsHard
  184. Dynamic Upper Convex Hull Maintenance via Slope-Ordered BSTComputational geometry · Dynamic Upper Convex Hull Maintenance via Slope-Ordered BSTHard
  185. Dynamic 2D Queries with a Compressed Range TreeGeometry / range structures · 2D range trees / coordinate compressionHard
  186. Rope Data Structure via Implicit TreapStrings / sequence trees · Rope Data Structure via Implicit TreapHard
  187. Incremental Minimum Spanning Forest via Link-Cut TreeDynamic/general trees · Incremental Minimum Spanning Forest via Link-Cut TreeHard
  188. Dynamic Suffix BST with Exact LCP UpdatesStrings / sequence trees · Suffix BST / exact LCPHard
  189. Minimum L1 Cost for a Nondecreasing SequenceOptimization DP · L1 isotonic regression / slope trickHard
  190. Heavy-Light Tree Decomposition with Path Splay TreesDynamic/general trees · Heavy-Light Tree Decomposition with Path Splay TreesHard
  191. Link-Cut Tree: Dynamic Forest Path Aggregates via Splay TreesDynamic/general trees · Link-Cut Tree: Dynamic Forest Path Aggregates via Splay TreesVery hard
  192. Kinetic Ordered Tree with Adjacent Crossing EventsGeometry / range structures · Kinetic Ordered Tree with Adjacent Crossing EventsVery hard
  193. Persistent Convex Hull Trick with Slope Trick via Persistent TreapGeometry / range structures · Persistent Convex Hull Trick with Slope Trick via Persistent TreapVery hard
  194. Euler Tour Tree via Implicit Treap for Dynamic Graph ConnectivityDynamic/general trees · Euler Tour Tree via Implicit Treap for Dynamic Graph ConnectivityVery hard
  195. Tango Tree: O(log log n) Competitive Binary Search TreeBST theory / balancing · Tango Tree: O(log log n) Competitive Binary Search TreeVery hard
  196. Static 2D Range Reporting with Fractional CascadingGeometry / range structures · Static range reporting / fractional cascadingVery hard
  197. Top Tree: Dynamic Forest Path and Subtree MaintenanceDynamic/general trees · Top Tree: Dynamic Forest Path and Subtree MaintenanceVery hard
  198. Overmars-van Leeuwen Fully Dynamic Convex HullGeometry / range structures · Overmars-van Leeuwen Fully Dynamic Convex HullVery hard
  199. Planar Point Location with a Persistent Sweep BSTGeometry / range structures · Planar Point Location with a Persistent Sweep BSTVery hard
  200. Cartesian Tree Isomorphism and Signature MatchingCartesian-tree pattern matching · Cartesian Tree Isomorphism and Signature MatchingVery hard