Beruflich Dokumente
Kultur Dokumente
Since each record has its data block address, searching for a record
in larger database is easy and quick. There is no extra effort to
search records. But proper primary key has to be selected to make
ISAM efficient.
ISAM method gives flexibility of using any column as key field and
index will be generated based on that. In addition to the primary key
and its index, we can have index generated for other fields too.
Hence searching becomes more efficient, if there is search based on
columns other than primary key.
6
2. Hash based Indexing: Hashing is the process of mapping a key
value to a position in a table is called Hashing.
Hashing is a technique used for performing insertions, deletions and
finds in constant average time (i.e. O(1))
Hash function is determines position of key in the array.
Hashing is widely useful technique for implementing Dictionaries
ADT.
Hash table ADT is an alternative solution with O(1) expected query
time and O(n +N) space, where N is the size of the table. Like an
array, but with a function to map the large range of keys into a
smaller one.
Properties and Hash Table : Hash Table properties are
Determinism
Uniformity.
Variable range,
Data normalization
Continuity. 7
Hash Table: Hash table ADT is an alternative solution with O(1)
expected query time and O(n +N) space, where N is the size of the
table. Like an array, but with a function to map the large range of keys
into a smaller one.
Hash Tables are favor efficient storage and retrieval of data lists which
are linear in nature.
Index Values / Data
0 ...
1
...
2
3
4
N-1 ...
All keys that map to the same hash value are kept in a list (or )
“bucket”, having a second key into a previously used slot is
called a collision.
The hash table is implemented as an array of linked lists,
inserting an item that hashes at index is simply insertion into
the linked list at position in the table.
Store all elements that hash to the same slot in a linked list,
store a pointer to the head of the linked list in the hash table
slot. 9
Ex: 23 ,24, 25, 26, 27, 28, 29, 30, 31, 32, 33 ,60
10
Factors affecting for Hashing: Hashing
offers excellent performance for insertion
and retrieval of data.
Load Factor
Operations
Insertion( )
Deletion( )
Initialization( )
Searching( )
Display ( )
Sorting ( )
Updation( )
Count( ) 13
Issues with Hashing
16
Applications
Relational DB Query processing
File Organization, Telephone Dictionaries.
Symbol table of a compiler.
Memory-management tables in operating systems.
Large-scale distributed systems.
Online spelling checkers.
Indexes
Search engine databases
Game programs - (transposition table)
17