Solve InterviewCake's bst-checker problem

Write a function that returns true if a given binary tree is a valid binary
search tree (i.e. if all of root's left nodes are less than root.value, all of
root's right nodes are greater than root.value, and both left and right subtrees
are also valid binary search trees).
This commit is contained in:
William Carroll 2020-03-15 23:09:29 +00:00
parent 47a11b76a2
commit 56d8d1d7b2
2 changed files with 112 additions and 2 deletions

View file

@ -22,7 +22,7 @@
** DONE Merging Meeting Times
* Trees and graphs
** DONE Balanced Binary Tree
** TODO Binary Search Tree Checker
** DONE Binary Search Tree Checker
** TODO 2nd Largest Item in a Binary Search Tree
** TODO Graph Coloring
** TODO MeshMessage
@ -33,7 +33,7 @@
** TODO Making Change
** TODO The Cake Thief
** DONE Balanced Binary Tree
** TODO Binary Search Tree Checker
** DONE Binary Search Tree Checker
** TODO 2nd Largest Item in a Binary Search Tree
* Queues and stacks
** TODO Largest Stack