What is a Cartesian tree?

What is a Cartesian tree? Correct Answer a tree which obeys heap property and whose inorder traversal yields the given sequence

A tree with heap property (parent is either small or big than children) and when traversed in inorder yields the given input sequence. refer below diagram question for clarity.

Related Questions