We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Trees: Is This a Binary Search Tree?
- Discussions
Trees: Is This a Binary Search Tree?
Trees: Is This a Binary Search Tree?
Sort by
recency
|
795 Discussions
|
Please Login in order to post a comment
how does the node structure look like?
Kotlin is broken, too. No hidden code at all, no checkBST function to start with.
data_list
ancestor
into node objects, which is somewhat cheating because may only be add in dynamic language such as Python, but can also be implement in other static languages by using data structure like dictionaries / hashmapsdata_list
is in order, and also no duplication (by checking length)This one is really bad in c. Not given any starter structures for tree. Not given any input scanning.
Due to this, the best implementation is to just read input and compare the values in order. Allocating memory to put this in a tree would be a waste.
if values are out of order, ret "No".