Menu

Java Analyze Implement Countdowntree Countdown Tree Node U Keeps Timer Ut Add X Remove X O Q43799474

In Java

Analyze and implement a CountdownTree. In a Countdown- Tree eachnode u keeps a timer u.t. The add(x) and remove(x) opera- tions areexactly the same as in a standard BinarySearchTree except that,whenever one of these operations affects u’s subtree, u.t isdecremented. When u.t = 0 the entire subtree rooted at u is rebuiltinto a perfectly balanced binary search tree. When a node u isinvolved in a rebuilding operation (either because u is rebuilt orone of u’s ancestors is rebuilt) u.t is reset to size(u)/3.

Your analysis should show that operations on a CountdownTree runin O(log n) amortized time. (Hint: First show that each node usatisfies some version of a balance invariant.)

Expert Answer


Answer to In Java Analyze and implement a CountdownTree. In a Countdown- Tree each node u keeps a timer u.t. The add(x) and remove…

OR