Skip to content

Wordcount Demo of unordered_map from Hash Table lecture.

Notifications You must be signed in to change notification settings

eecs281staff/wordcount-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Word Count Demo

This simple demo uses an unordered map to count the number of occurrences of each word in a text file. The words and their counts are then copied to a vector of pairs, and the vector is sorted by the number of occurrences in descending order, to produce a list of the most frequently used words.

How to

After cloning or downloading the repository, you can build and run the demo with the following commands:

$ cd wordcount-demo
$ g++ -std=c++17 wordcount.cpp -o wordcount
$ ./wordcount
Enter filename: getty.txt
that                   13
the                    11
we                     10
here                    8
to                      8
a                       7
and                     6
it                      5
can                     5
for                     5

About

Wordcount Demo of unordered_map from Hash Table lecture.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages