Question: Need help on Python coding. Using import collections import time import sys from typing import List from typing import Tuple to finish the rest of

Need help on Python coding.

Using

import collections import time import sys from typing import List from typing import Tuple 

to finish the rest of the code. required to read the document from the computer

Need help on Python coding. Using import collections import time import sysfrom typing import List from typing import Tuple to finish the rest

2 Implementation Write a program, merchants.py, that demonstrates the performance differences between using Quickselect and Quicksort to solve the problem of finding the median location for the new merchant 2.1 Command Line The program is run on the command line as If the number of command line arguments is incorrect, display a u If slow is specified, use Quicksort to find the merchant at the median location, otherwise $ python3 merchants.py [slowlfast] input-file sage message and exit Usage: python3 merchants.py [slowlfast] input-file assume fast is specified and use Quickselect Assume the input file exists, and it contains at least one merchant. The in-lab activity downloaded a series of test files that to use 2.2 Program Output When the program runs, it will produce 5 lines of output The search type that was specified on the command line: The total number of merchants in the input file: The time it took to perform the search, in seconds The merchant at the median: The sum of the distances from the optimal location, to all the other merchant locations Search type: [slowlfast] Number of merchants: # Elapsed time: # seconds Optimal store location : Merchant (name="XXX', location=#) Sum of distances: # 2 Implementation Write a program, merchants.py, that demonstrates the performance differences between using Quickselect and Quicksort to solve the problem of finding the median location for the new merchant 2.1 Command Line The program is run on the command line as If the number of command line arguments is incorrect, display a u If slow is specified, use Quicksort to find the merchant at the median location, otherwise $ python3 merchants.py [slowlfast] input-file sage message and exit Usage: python3 merchants.py [slowlfast] input-file assume fast is specified and use Quickselect Assume the input file exists, and it contains at least one merchant. The in-lab activity downloaded a series of test files that to use 2.2 Program Output When the program runs, it will produce 5 lines of output The search type that was specified on the command line: The total number of merchants in the input file: The time it took to perform the search, in seconds The merchant at the median: The sum of the distances from the optimal location, to all the other merchant locations Search type: [slowlfast] Number of merchants: # Elapsed time: # seconds Optimal store location : Merchant (name="XXX', location=#) Sum of distances: #

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!