{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

hw3_11 - Prove that not both these operations can be done...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CSC 7300 Fall 2011 Homework 3 due date 10/10/11, in class, 100 points 1. Consider a data structure S supporting two operations: insert( S, x ) and extract low( S ). Here, extract low returns(and removes) any number y such that y is smaller than the current median. Show how to design S such that both the operations can be done in amortized O (1) time. 2. Consider a base-3 counter : each digit can be one of 0 , 1 , 2. The cost of increment operation is number of digits that get changed. What is the amortized cost of this operation? Design an appropriate potential function. 3. Consider an almost-priority-queue data structure, which allows two operations: insert and extract almost min. extract almost min operation outputs either the first minimum or a second minimum item from the current structure (and doesn’t tell you which it outputted).
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Prove that not both these operations can be done in o (log n ) time even if amortization is allowed. 4. Consider the cut operation in Fibonacci heaps. In the usual implementation, a node is cut as soon as it loses two of its children. Let’s change this rule: a node is cut as soon as it loses three of its children. Analyse this variant of Fibonacci heap. Is MaxDeg ( n ) still O (log n )? 5. In next class, we’ll show that insertions in red-black trees cost 2 rotations (case 2) and upto O(log n) color changes (case 1). Show that amortized color updates per insertion is O(1). (Hint: to develop an appropriate potential function try to see what is decreasing in the structure when we push the red-conflict upwards in case 1.) 1...
View Full Document

{[ snackBarMessage ]}