Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/r100-stack/hashing-strings
Finding word frequency of a text file by hashing strings using the Horner's rule
https://github.com/r100-stack/hashing-strings
hashing-algorithm horner-s-rule word-count word-frequency
Last synced: 26 days ago
JSON representation
Finding word frequency of a text file by hashing strings using the Horner's rule
- Host: GitHub
- URL: https://github.com/r100-stack/hashing-strings
- Owner: r100-stack
- Created: 2020-10-31T06:27:41.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2020-11-02T04:25:00.000Z (about 4 years ago)
- Last Synced: 2025-01-01T07:08:05.214Z (26 days ago)
- Topics: hashing-algorithm, horner-s-rule, word-count, word-frequency
- Language: C
- Homepage: https://lsu.zoom.us/rec/share/osWc5VtLPKqo0EzFmx-7B8KU8dYwzluwxQpRQFLJvfVk4YPORxIhFYh4RMwaSxhV.jh14Vy4pCPJYv9tI
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hasing Strings
All SI session info on [csc3102si.rohankadkol.com](https://csc3102si.rohankadkol.com)
## Intro
**[SI session recording](https://lsu.zoom.us/rec/share/osWc5VtLPKqo0EzFmx-7B8KU8dYwzluwxQpRQFLJvfVk4YPORxIhFYh4RMwaSxhV.jh14Vy4pCPJYv9tI)**
This is a code example to hash strings using the Horner's rule. For more information, refer to slide 13 of Dr Shah's slide deck, "3102 14 2020 (Hashing)" under the Moodle section, "Hashing".
Also you can **[watch the recording](https://lsu.zoom.us/rec/share/osWc5VtLPKqo0EzFmx-7B8KU8dYwzluwxQpRQFLJvfVk4YPORxIhFYh4RMwaSxhV.jh14Vy4pCPJYv9tI)** where I explain the algorithm and each line of code in detail.
## To run the code (Linux / MacOS)
```
./main < textFile.txt
```## Sample Text File
```
the fox Fox Fox jumps jumps jumps in in in a cart jumps ,,./, steal the
```## Sample Output
```
$ ./main < textFile.txt
**
hashAddress = 27
Word: in, Frequency: 3
Word: Fox, Frequency: 2
**
hashAddress = 38
Word: cart, Frequency: 1
**
hashAddress = 59
Word: fox, Frequency: 1
**
hashAddress = 85
Word: jumps, Frequency: 4
**
hashAddress = 97
Word: a, Frequency: 1
**
hashAddress = 126
Word: steal, Frequency: 1
**
hashAddress = 132
Word: the, Frequency: 2
```