Skip to main content

Posts

Showing posts from March, 2020
Review Material Structure ·        Is user-defined datatype ·        In struct or the struct member can be predefined datatype, array, or struct. ·        Can be made as variable or array; Ex:       Struct name{                   Int x;                   Char y[10];       }             Struct name a, b[10]; DataStruct Is an arrangement of data, either in the computer’s memory or on the disk storage. Common example of data structure : 1.      Array                = collection of the same data type 2. ...

Hashing & Hash Table

Hashing & Hash Table Hashing is a technique used to access value in database or array faster. The way hashing works is the original string of characters are transformed in to short length value or key called Hash Key, that represent the original string or as index to access original value stored in array called Hash Table or database. The way to hash a string is called Hash Function. There is some important methods to construct hash function : ·        Mid-square square the string / identifier and extract the middle r bits of the result. ·        Division ( most common ) Divide the string /identifier using modulus operator by value M (can be any value but usually prime number, table size or the size of memory used. ·        Folding Divide each value into number of part with the same number of digits. Sum all of the part. If there is last carry in hash value, th...