Hash Table data structures explained

Hashing is a technique used to search an specific item in large group of items. Hashing uses hash table to perform search in an constant O(1) time. Hashing uses hash functions to fill items in a hash table. To search, each key is passed into the same hash function which computes an index which provides the corresponding value location.

A Hash table data structures are used in hashing which stores all the key value pairs.

Let’s have a look at the ideal hash table.

(more…)
Hash Table data structures explained Read More

Program to Find Duplicate Files in a File System

Given in a directory, we have to write a program to find duplicate files in the file system.
For eg:
Let’s assume we have following files and it’s content in the file system.

char files[][80][80] = {{"1.txt", "abcd"},
                        {"2.txt", "efgh"},
                        {"3.txt", "efgh"},
                        {"4.txt", "abcd"},
                        {"5.txt", "efgh"},
                        {"6.txt", "efgh"},
                        {"7.txt", "xyz"}

Based on above input, duplicate files are – “1.txt” and “4.txt”. “2.txt”, “3.txt”, “5.txt” and “6.txt” are also duplicate files.

(more…)
Program to Find Duplicate Files in a File System Read More

Hash Table With Double Hashing and Its Basic Implementation

Hashing is a technique used to search an specific item in large group of items. Hashing uses hash table to perform search in an constant O(1) time. Hashing uses hash functions to fill items in a hash table. To search, each key is passed into the same hash function which computes an index which provides the corresponding value location.
Before going ahead have a look into Hashing Explanation.

(more…)
Hash Table With Double Hashing and Its Basic Implementation Read More

Hash Table With Quadratic Probing and Its Basic Implementation

Hashing is a technique used to search an specific item in large group of items. Hashing uses hash table to perform search in an constant O(1) time. Hashing uses hash functions to fill items in a hash table. To search, each key is passed into the same hash function which computes an index which provides the corresponding value location.
Before going ahead have a look into Hashing Explanation.

(more…)
Hash Table With Quadratic Probing and Its Basic Implementation Read More

Hash Table With Linear Probing and Its Basic Implementation

Hashing is a technique used to search an specific item in large group of items. Hashing uses hash table to perform search in an constant O(1) time. Hashing uses hash functions to fill items in a hash table. To search, each key is passed into the same hash function which computes an index which provides the corresponding value location.
Before going ahead have a look into Hashing Explanation.

(more…)
Hash Table With Linear Probing and Its Basic Implementation Read More

Hash Table With Separate Chaining and Its Basic Implementation

Hashing is a technique used to search an specific item in large group of items. Hashing uses hash table to perform search in an constant O(1) time. Hashing uses hash functions to fill items in a hash table. To search, each key is passed into the same hash function which computes an index which provides the corresponding value location.
Before going ahead have a look into Hashing Explanation.

(more…)
Hash Table With Separate Chaining and Its Basic Implementation Read More

Hash Table and Its Basic Implementation

Hashing is a technique used to search an specific item in large group of items. Hashing uses hash table to perform search in an constant O(1) time. Hashing uses hash functions to fill items in a hash table. To search, each key is passed into the same hash function which computes an index which provides the corresponding value location.
Before going ahead, have a look into Hashing explanation.

(more…)
Hash Table and Its Basic Implementation Read More