Examveda

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?

A. use linked lists

B. use avl trees

C. use red-black trees

D. use treaps (cartesian trees)

Answer: Option D


This Question Belongs to Data Structure >> Binary Search Trees(B Tree)

Join The Discussion

Related Questions on Binary Search Trees(B Tree)