gs gs121 Binary Trees - Cartesian Tree - Quiz No.1
gs gs121 Data Structures and Algorithms Quiz
This quiz belongs to book/course code gs gs121 Data Structures and Algorithms of gs organization. We have 169 quizzes available related to the book/course Data Structures and Algorithms. This quiz has a total of 10 multiple choice questions (MCQs) to prepare and belongs to topic Binary Trees. NVAEducation wants its users to help them learn in an easy way. For that purpose, you are free to prepare online MCQs and quizzes.
NVAEducation also facilitates users to contribute in online competitions with other students to make a challenging situation to learn in a creative way. You can create one to one, and group competition on an topic of a book/course code. Also on NVAEducation you can get certifications by passing the online quiz test.
i. Cartesian tree is not a height balanced tree
ii. Cartesian tree of a sequence of unique numbers can be unique generated
i. construct a cartesian tree for input sequence
ii. put the root element of above tree in a priority queue
iii. if( priority queue is not empty) then
iv. search and delete minimum value in priority queue
v. add that to output
vi. add cartesian tree children of above node to priority queue
array=60 90 10 100 40 150 90 reverse 2 to 3 array=60 10 90 100 40 150 90 reverse 3 to 6 array= 60 100 150 40 100 90 90 now printout from 1 to 6 :-- 60 100 150 40 100 90
How to achieve the above operation efficiently?