Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword or section
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
Cormen Algo-lec13

Cormen Algo-lec13

Ratings: (0)|Views: 27|Likes:
Published by geniusamit

More info:

Published by: geniusamit on Feb 23, 2009
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF or read online from Scribd
See more
See less

05/10/2014

 
October 31, 2005
Copyright ©2001-5 by Erik D. Demaine and Charles E. Leiserson
L13.1
 Introduction to Algorithms
6.046J/18.401JL
ECTURE
13
Amortized Analysis
Dynamic tablesAggregate methodAccounting methodPotential method
Prof. Charles E. Leiserson
 
October 31, 2005
Copyright ©2001-5 by Erik D. Demaine and Charles E. Leiserson
L13.2
How large should a hashtable be?
Goal:
Make the table as small as possible, butlarge enough so that it won’t overflow (or otherwise become inefficient).
Problem:
What if we don’t know the proper sizein advance?
I
DEA
:
Whenever the table overflows, “grow”it by allocating (via
 malloc
or 
new
) a new, larger table. Move all items from the old table into thenew one, and free the storage for the old table.
Solution:
 Dynamic tables.
 
October 31, 2005
Copyright ©2001-5 by Erik D. Demaine and Charles E. Leiserson
L13.3
Example of a dynamic table
1.I
 NSERT1
2.I
 NSERT
overflow

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->