Skip to content

Latest commit

 

History

History
27 lines (16 loc) · 829 Bytes

File metadata and controls

27 lines (16 loc) · 829 Bytes

Determine if Binary Search Tree

Given the root of a tree, determine if it is a binary search tree (BST).

Whiteboard Process

Whiteboard

Approach & Efficiency

Considered multiple approaches to this solution, looking at the impact of recursion over iteration. Talked through the approaches with JB for understanding, went through the whiteboarded exercise and used chatgpt as a resource on the code and Big O.

Resources:

Big O

Time Complexity: O(n) b/c each element in the input list will be visited

Space Complexity: O(h) with h representing the height of the tree

Solution

See whiteboard