Simple HashTable Example

Category:
String Manipulation
Type:
Classes
Difficulty:
Intermediate
Author:
Mortaza Doulaty

Version Compatibility: Visual Basic 6

More information:
Hash tables are used to store data in them, like arrays, but the difference is this: to find an item in an array, it has an order of O(n), but in hash tables, the order is O(1). There are different methods for implementing hash tables. One of the common problems with hash tables is collision. In the case of collision we can do different things: 1) Add the item in the next empty row. 2) Have an over-flow table. 3) Have items linked to each other in one row with pointers. In this simple demonstration, the first and easiest method is chosen.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: