Skip to main content

Posts

Showing posts from September, 2012

Hash tables

Hash tables (I) A  hash table is a data Structure that offer very fast insertion and search sometimes deletion almost in O( 1) in the best cases.   O( 1) means few machine instructions to finish the operation   Advantages of Hash Tables : fast  easy to code Disadvantages of Hash Tables :   based on Array (Array is fixed length data structure) performance may be degraded catastrophically when the table is full. no convenient way to visit item n hash table. What is hashing ? hashing means convert range of key values into range of Array index. for example : suppose you are writing a program to access  employee records in small company say 1000 employees . requirement : database used one mega byte  fastest access to any individual record employees are seldom laid off and even happen their records still exist.  every employee has been given number from 1(from the founder) to 1000 (the most recent employee ) , this employee numbers can be used as keys. we