Friday 18 October 2013

TREAP ( Binary Search Tree + Heap )

Getting back to Data Structures after quite a long time :P ( Hope this makes a good read )

Useful links to understand TREAP :
http://faculty.cs.niu.edu/~freedman/340/340notes/340treap.htm
http://www.cs.cornell.edu/Courses/cs312/2003sp/lectures/lec26.html
http://electures.informatik.uni-freiburg.de/portal/download/7/8207/04_Treaps_4up.pdf
http://ieng6.ucsd.edu/~cs100s/Exams/TreapExamples.pdf

Input :
i n      // to insert n
d n    // to delete n
s n    // to search for n
p      // to print the current situation of treap