Answered step by step
Verified Expert Solution
Question
1 Approved Answer
the access log file consists of 275,000 lines of logs just like the sample in the picture attached: question in text: You are expected to
the access log file consists of 275,000 lines of logs just like the sample in the picture attached:
Yos are expocted to write a C++ console application which teads a tont file that eotsists of logs of a wib aerver. An example part of the log file is given below: Afer reading and procesing is over, your program mast liat the 7op 10 mout vinited web pagen. Sample eutput : Flesamet of not viaits Fiename2, of wol vinits Filenamel if of total viaits Filenameto if of total viais Totil Elapeod Time : X recench The application can be implemented with oonsole facilities 6 oev do not need alvanced cut elements). You are roquired to do the following taiks: Task1: You must implement a hash table as your main data structure. You should implement your own hash table, you cannot use a hash table implementation from a library. This implementation should be a proper C++ class. You should use this hash table for storing the filenames and the corresponding number of visits of that page (filename). There is no restriction on the choice of the hash function and collision resolution method. Task2: Use std::unordered map data structure for storing the filenames and the corresponding number of visits. Task 3: In order to compare the efficiency of your own hash table implementation and std: unordered_map, write a program which measures the total time it takes starting from reading access_log file until the end of printing the top 10 most visited pages. There is no need to ask user input. Note1: For finding the top 10 most visited pages try to find an efficient method. Hint: you can use the heap data structures. Note2: Other than the hash table implementation, you can use C++ standard library for your needs question in text:
You are expected to write a C++ console application which reads a text file that consists oflogs of a web server. An example part of the log file is given below:HTTP ReplyBytes inHostTimeStampFilenameCodeReplylocal --[24/Oct/1994:13:41:41 -0600] "GET index.html HTTP/1.0" 200 150local --[24/Oct/1994:13:41:41 -0600]"GET 1.gif HTTP/1.0" 200 1210local --[24/Oct/1994:13:43:13 -0600]"GET index.html HTTP/1.0" 200 3185local --[24/Oct/1994:13:43:14 -0600] "GET 2.gif HTTP/1.0" 200 2555local --[24/Oct/1994:13:43:15 -0600] "GET 3.gif HTTP/1.0" 200 36403local --[24/Oct/1994:13:43:17 -0600] "GET 4.gif HTTP/1.0" 200 441local --[24/Oct/1994:13:46:45 -0600] "GET index.html HTTP/1.0" 200 3185......After reading and processing is over, your program must list the top 10 most visited web pages. Sample output :Filename1 # of total visitsFilename2 # of total visitsFilename3 # of total visits...Filename10 # of total visitsTotal Elapsed Time : X secondsYou should extract the filenames from each line. For example, the first line in the abovelog file contains the filename index.htmlandthe second line contains the filename 1.gif.The application can be implemented with console facilities(you do not need advanced GUI elements). You are required to do the following tasks:
Task1: You mustimplement a hash table as yourmaindata structure.You should implement your own hash table, you cannot use a hash table implementation from a library.Thisimplementationshould be a proper C++ class. You shoulduse this hash table for storingthe filenames and the corresponding number of visits of thatpage (filename). There is no restriction on the choice of the hash function and collision resolutionmethod.Task2: Use std::unordered_map data structure for storing the filenames and the corresponding number of visits.Task 3:In order to compare the efficiency of your own hash tableimplementation and std::unordered_map,write a program which measures the total time it takes starting from reading access_log file until the end of printing thetop 10 most visited pages. There is no need to ask user input.Note1: For finding the top 10 most visited pages try to find an efficient method. Hint: you can use the heap data structures.Note2:Other than the hash table implementation, you can use C++ standard library for your needs.
thank you.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started