Skip to content

BinaryBun/hash_map8bit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 

Repository files navigation

About

Basic hash-map[string]string on 8bit Pearson's hash-function.

How it worked

An array of 255 elements of the *List type is reserved.
The hash function has an output range [0...255] of type int.
If there is a collision, the linked list is expanded by one element at the end.

Has map structure

Example

Code Output
// ...
// some code
func example() {
  data := Map{}
  data.insert("hello", "1")
  data.insert("world", "1")
  data.insert("hello", "2")
  data.insert("!", "3")

  fmt.Println(data.get_value("hello"))
  fmt.Println(data.keys())
}
2
["hello" "world" "!"]

About

Hash map on 8bit hash function (Pearson hash)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages