Solution Review: Finding Ancestors of a Given Node in a BST
Learn a detailed analysis of the different ways to solve the “Finding Ancestors of a Given Node in a Binary Search Tree” challenge.
We'll cover the following...
We'll cover the following...
Solution #1: Using a recursive helper function #
This solution uses a recursive helper function that starts traversing from the root until the input node and backtracks to append the ancestors that led to the node.
Time complexity
This is the ...