Amazon Coding Interview Question: Is this a Binary Search Tree? - Easy Theory
Easy Theory
Here we tackle the question of determining, given a binary tree, whether it is a binary search tree. The key to note is that any node is the "root" of some tree, so any node to the left of it must be at most its value, and any to the right must be at least that value. So the important part of the algorithm is to "filter down" the value of the node to the two children based on which direction the child is (either left or right).
Easy Theory Website: https://www.easytheory.org Become a member: https://www.youtube.com/channel/UC3VY6RTXegnoSD_q446oBdg/join Donation (appears on streams): https://streamlabs.com/easytheory1/tip Paypal: https://paypal.me/easytheory Patreon: https://www.patreon.com/easytheory Discord: https://discord.gg/SD4U3hs
Merch: Language Hierarchy Apparel: https://teespring.com/language-hierarchy?pid=2&cid=2122 Pumping Lemma Apparel: https://teespring.com/pumping-lemma-for-regular-lang
If you like this content, please consider subscribing to my channel: https://www.youtube.com/channel/UC3VY6RTXegnoSD_q446oBdg?sub_confirmation=1
▶SEND ME THEORY QUESTIONS◀ ryan.e.dougherty@icloud.com
▶ABOUT ME◀ I am a professor of Computer Science, and am passionate about CS theory. I have taught many courses at several different universities, including several sections of undergraduate and graduate theory-level classes. ... https://www.youtube.com/watch?v=OfRSa3mUWeo
90545885 Bytes