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(fileSize, fileName):
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(fileSize, fileName):
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(fileSize, fileName):
The file100000 in question 2 is shown in question 1.
QUESTION 2:
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 orderedSequentialSearch, binarySearch, and HashTable code given in
Fill the hash table with key values stored in the file100000. 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 “searchStats.txt”. The “searchStats.txt” file should contain entries for execution times as follows:
Linear_Search n
Binary_Search n Hashing n
where n is the total execution time for searching these 1000 numbers
QUESTION 1:
Process or set of rules that allow for the solving of specific, well-defined computational problems through a specific series of commands. This topic is fundamental in computer science, especially with regard to artificial intelligence, databases, graphics, networking, operating systems, and security.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.