+1 vote
in Data Structures & Algorithms I by (110k points)
What is a Cartesian tree?

(a) a skip list in the form of tree

(b) a tree which obeys cartesian product

(c) a tree which obeys heap property and whose inorder traversal yields the given sequence

(d) a tree which obeys heap property only

My question is taken from Cartesian Tree topic in section Binary Trees of Data Structures & Algorithms I

I got this question in homework.

1 Answer

+1 vote
by (672k points)
selected by
 
Best answer
The correct option is (c) a tree which obeys heap property and whose inorder traversal yields the given sequence

The explanation is: 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

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.

Categories

...