In this homework, we consider the following task. We consider a sequence of events, where each event is either an IP address or a query. If the event is a query, we should compute the most frequent IP address among the previous 100,000 IP addresses seen. In our simulation of these events, we simply take an IP address to mean an integer between 0 and 10,000 (but please bear in mind that this is not what IP addresses actually are).

The program here implements two different algorithms for storing the last 100,000 IP addresses and answering such queries. The first algorithm uses a hash table and a queue for storing the last 100,000 IP addresses seen. The second algorithm uses a queue as above, along with a hash table and adaptable priority queue. (Indicentally, understanding this second algorithm will tell you why location aware priority queues are useful.)

This homework is about understanding and comparing these two implementations. You need to do the following:

Submit your observations (this should include the record of the running times) and your explanations as a text file into a dropbox in ICON called Homework10. This assignment is due by 11:59 pm on Wednesday, Dec 7.