Question: (PHYTON) PLEASE JUST SOLVE Q2 .) AND USE PHYTON !!! AND SOLVE IT CORECT'!!!! T S MPORTANT AND EXPLAN WELL THANK YOU !!! Q1) Q2)
(PHYTON) PLEASE JUST SOLVE Q2 .) AND USE PHYTON !!! AND SOLVE IT CORECT'!!!! T S MPORTANT AND EXPLAN WELL THANK YOU !!!
Q1)

Q2)

The objective of this question is to generate and read files that contain a list of random numbers. Write a function that generates a file with following parameters: def fillFile(file Size, fileName): The function should be called to generate files in the following sizes: fileSizes = [1000, 5000, 10000, 25000, 50000, 100000, 200000] The generated files can have names file1000, file 5000, file 10000, file25000, file 50000, file 100000, file200000. Each file should have serial numbers from 0 to size of file. By using one tenth of file shuffle numbers among themselves. For example, if your file 100 numbers, choose 10 numbers randomly and shuffle these numbers. You can use random.randint(0.fileSize=1000) to generate a random number. Write another function that reads numbers inside of a file and returns a list def readFile(fileName): The returned list contains the numbers stored in the file. At each call of fillFile and readFile, record the times before and after the function call as in following example (import time): start = time time fillFile(fileSize, "file" + str(fileSize)) finish = time.time runTime = finish - start Record the run times of functions into a file named "fileStats.txt. The fileStats.txt" file should contain entries for run times as follows: fillFile ni, n2, n3, nd, no, no, n? readFile nl, n2, n3, n4, no, no, n7 where nl, n2, n3.n4, n5, n and n7 are execution times for file sizes 1000, 5000, 10000, 25000, 50000, 100000, 200000. Submit your program code and filleStats.txt in ZIP file together with the solutions of other programs. Perform a benchmark analysis of the following searching methods: Linear (Sequential) Search Binary Search Hashing Read the file "file100000" into a list Sort the file using the one of fast sorting algorithms. You can use ordered SequentialSearch, binarySearch, and HashTable code given in https://runestone.academy/runestone/books/published/pythonds/SortSearch/toctree.html. Fill the hash table with key values stored in the file 100000. The data values mapping to the key values can be assigned to a string like Data" + str(key). Make the hash table size 10% bigger. For example you can set self size = 110017 which is a prime number. Generate a list of 1000 random numbers using random.randint(0,100000). By using the searching methods, make a search of these random numbers. Record their total execution times into a file named "search Stats.txt. The "search Stats.txt" file should contain entries for execution times as follows: Linear_Search n n Binary_Search n Hashing where n is the total execution time for searching these 500 numbers. Submit your program code and searchStats.txt in ZIP file together with the solutions of other Programs
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
