Validate Binary Search Tree with Opaque Value Type (Iterative DFS)
Given the root of a binary tree whose node values node.val have an unknown type (you must not assume int), but you are given a comparison function less(a, b) that returns true when a < b. Dete...
Example
Unlock to view complete problem details
and practice with sample input/output
Was this article helpful?
View Test Cases & Run Code requires membership
Standard Input
Execution Result:
