My Report (&Account)

Top Tree Test


Correct Answer: 2 points | Wrong: -1 point
Grades: A* (100% score) | A (80%-99%) | B (60%-80%) | C (40%-60%) | D (0%-40%)

1. Cartesian trees are most suitable for?

2. A treap is a cartesian tree with ___________

3. What is a Cartesian tree?

4. Is the below tree representation of 50,100,400,300,280 correct way to represent cartesian tree?
The figure satisfies inorder yields the given input sequence

5. Cartesian trees solve range minimum query problem in constant time.

6. Consider a sequence of numbers to have repetitions, how a cartesian tree can be constructed in such situations without violating any rules?

7. What happens if we apply the below operations on an input sequence?
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

8. Consider below sequences.

    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?

9. What is the speciality of cartesian sorting?

10. Which of the below statements are true?
i. Cartesian tree is not a height balanced tree
ii. Cartesian tree of a sequence of unique numbers can be unique generated


 

Start practicing “1000 MCQs on Data Structure”, and once you are ready, you can take tests on all topics by attempting our “Data Structure Test Series”.

advertisement
advertisement
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.