Coder Social home page Coder Social logo

rohan-kadkol / hashing-strings Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 13 KB

Finding word frequency of a text file by hashing strings using the Horner's rule

Home Page: https://lsu.zoom.us/rec/share/osWc5VtLPKqo0EzFmx-7B8KU8dYwzluwxQpRQFLJvfVk4YPORxIhFYh4RMwaSxhV.jh14Vy4pCPJYv9tI

C 100.00%
hashing-algorithm horner-s-rule word-frequency word-count

hashing-strings's Introduction

Hasing Strings

All SI session info on csc3102si.rohankadkol.com

Intro

SI session recording

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 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

hashing-strings's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.