Question
All these task are related to each other don't skip any task. Provide code in C or C++. Please don't copy other's answer. Make sure
All these task are related to each other don't skip any task. Provide code in C or C++. Please don't copy other's answer. Make sure the code is running without any error and provide the output.
Task 1 : Random number generation - Create a random number generator to create a list of unique integers (each number must appear only once). The code for this generator can be obtained from the internet. It must be able to generate at least 300 integers (no repeated numbers) by using your matric ID(191020880) as a seed generator.
Task 2: Searching Implementation - Implement linear search, interpolation search and binary search to search an integer from a list of integers from task 1.
Task 3 :Testing - Create a main function which is able to call the number generator and all algorithms. Apply the testing procedure:
Searching
By using the function from Task 1, generate 100 unique integers. Output the list in a 100data.txt or 100data.csv file. Get the last integer in the list as k.
Read the integers from the file in an array or linked list. Apply the algorithms in Task 2 to find k from the list. Record the time taken by each of the algorithms as shown in Table 2.
Repeat the process with 200 and 300 unique integers.
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