ta11_question - set S of integers: • Insert( S,x )...

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

View Full Document Right Arrow Icon
COMP 271H Design and Analysis of Algorithms 2006 Fall Semester Tutorial 11 1. (From textbook) A sequence of n operations is performed on a data structure. The i th operation costs i if i is an exact power of 2, and 1 otherwise. Determine the amortized cost per operation in two ways: (i) using the accounting method; (ii) using the potential method. 2. (From textbook) Design a data structure to support the following two operations for a
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: set S of integers: • Insert( S,x ) inserts x into S . • Delete-Larger-Half( S ) deletes the largest ⌈ S/ 2 ⌉ elements from S . Explain how to implement this data structure so that any sequence of m operations runs in O ( m ) time. 1...
View Full Document

This note was uploaded on 12/09/2010 for the course ENGLISH 1303 taught by Professor May during the Spring '10 term at HKU.

Ask a homework question - tutors are online