Skip to content

Latest commit

 

History

History
17 lines (9 loc) · 609 Bytes

README.md

File metadata and controls

17 lines (9 loc) · 609 Bytes

Algorithm Used:

  1. Read the file from server line by line using fopen() function
  2. using ' '(Space) as a delimiter segregatted words from the file
  3. Using hashmap to create (key,value) pair for each unique words ie key = unique words , value = count of those words
  4. sorted the hashmap according to the value;
  5. print the top n values among them

Note: for a dynamic file use of heap data structure would have been the best option since it is a static i have used hashmap + sorting technique.

The file is hosted in my domain : http://islamquiz.in/input.php

Go to the above website for real demo.