Share your repls and programming experiences

← Back to all posts
UlkuKilic (1)

Exercise 7.8.Design and implement an algorithm that constructs a Treap from a sorted array, a, of n elements. This method should run in O(n)worst-case time and should construct a Treap that is indistinguishable from one in which the elements of a were added one at a time using the add(x) method.