[SOLVED] Python -  Homework2 - Where is this IP

35.00 $

Programming resource
Digital learning resource
Category:
✓ Practical programming resource
✓ Suitable for guided study and reference
✓ Tutor guidance available when needed

Description

5/5 - (1 vote)

Related Topics
+ Basic python syntax
+ Basic file I/O
+ 1D list, dictionary handling
+ Sorting algorithm
+ Searching algorithm
## Introduction
In this homework, we have a json file with **40000** IPs along with its corresponding city (ofcourse it’s fake data generated by python module `mimesis`), and the task is to design aquery system to search city for specific IP (100 querys) within reasonable time constraint.

## Related Files
We provide the followings files:
+ query.csv
+ ip_data.json

and you should generate a answer file in csv format, refer to docstring for more detailinformation.

## Requirement
Given the template code provided by TA, you need to fulfill all the methods and functions in the code. The score/point for each method or function is explained in the docstring.

## Evaluate
Your script will be tested with following command:

“`
python3 hw2.py <path to ip_data.csv> <path to query.csv> <path to answer.csv>
“`

#### Must Read
+ Do not use third-party packages such as numpy, pandas, and etc.
+ Do not hard-coded the path in your script. **Use relative path**.
+ Built-in `list.sort()` and `sorted()` are prohibited, you should implement your sort.
+ Do not copy others code. (0 scores for punishment)

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.