Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

-I WILL UPVOTE IF YOU HELP ME DO THE CODE CORRECTLY WITHOUT ERRORS BASED ON THE QUESTION -DESCRIBE EACH FUNCTION USED IN THE CODE -

image text in transcribed

image text in transcribed

-I WILL UPVOTE IF YOU HELP ME DO THE CODE CORRECTLY WITHOUT ERRORS BASED ON THE QUESTION

-DESCRIBE EACH FUNCTION USED IN THE CODE

- DISCUSS THE BIG O Algorithm Complexity

-DISCUSS A BETTER IDEA OF HOW SEARCHING CAN BE MADE MORE EFFICIENT THAN THE ALGORITHMS USED IN THE QUESTION

- PLEASE DO IN C PROGRAM

- PLEASE USE MY MATRIC ID : 191022310

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 as a seed generator. Write the pseudocode of the function in your report Task 2: Searching Implementation - Implement linear search, interpolation search and binary search to search an integer from a list of integers. The code for these algorithms can be obtained from the internet (e.g., http://www.geeksforgeeks.org). However, detail remarks (comments) by using your own words are required to be provided in the code to show your understanding of the code. Each function must be accompanied by comments.* Extra mark will be given if you implement additional searching algorithms for this task. Task 3: Complexity Analysis - Theoretically discuss and compute the complexity of all searching algorithms that you implemented. The discussion will describe your understanding of the algorithm. Put the complexity on a table as shown in Table 1 and Execution Time (in milliseconds) as shown in Table 2. Table 1: Complexity Analysis Algorithm Algorithm 1 Algorithm 2 Complexity o(logo) O(n) Table 2: Execution Time (in milliseconds) Algorithm 1 Algorithm 2 Algorithm 100 integers 200 integers 300 integers Task 4: Testing - Create a main function which is able to call the number generator and all algorithms. Apply the testing procedure: Searching 0) 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. ii) 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. Task 5: Writing Report - Write the report. The report must contain 1) The description of each function in the code (the input, output, what it does, a reference to the source of the code if you get the code from the internet). ii) The complexity analysis (using Big O notation) and the time taken (in milliseconds) to execute your number generator and each searching algorithms in your program (see Table 1 and Table 2). E.g.: Table 1: Complexity Analysis Algorithm Algorithm 1 Algorithm 2 Algorithm 3 Complexity Odlog n) | 0 (n) 0(1) Table 2: Execution Time (in milliseconds) Algorithm 1 Algorithm 2 Algorithm 3 Algorithm 100 integers 200 integers 300 integers 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 as a seed generator. Write the pseudocode of the function in your report Task 2: Searching Implementation - Implement linear search, interpolation search and binary search to search an integer from a list of integers. The code for these algorithms can be obtained from the internet (e.g., http://www.geeksforgeeks.org). However, detail remarks (comments) by using your own words are required to be provided in the code to show your understanding of the code. Each function must be accompanied by comments.* Extra mark will be given if you implement additional searching algorithms for this task. Task 3: Complexity Analysis - Theoretically discuss and compute the complexity of all searching algorithms that you implemented. The discussion will describe your understanding of the algorithm. Put the complexity on a table as shown in Table 1 and Execution Time (in milliseconds) as shown in Table 2. Table 1: Complexity Analysis Algorithm Algorithm 1 Algorithm 2 Complexity o(logo) O(n) Table 2: Execution Time (in milliseconds) Algorithm 1 Algorithm 2 Algorithm 100 integers 200 integers 300 integers Task 4: Testing - Create a main function which is able to call the number generator and all algorithms. Apply the testing procedure: Searching 0) 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. ii) 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. Task 5: Writing Report - Write the report. The report must contain 1) The description of each function in the code (the input, output, what it does, a reference to the source of the code if you get the code from the internet). ii) The complexity analysis (using Big O notation) and the time taken (in milliseconds) to execute your number generator and each searching algorithms in your program (see Table 1 and Table 2). E.g.: Table 1: Complexity Analysis Algorithm Algorithm 1 Algorithm 2 Algorithm 3 Complexity Odlog n) | 0 (n) 0(1) Table 2: Execution Time (in milliseconds) Algorithm 1 Algorithm 2 Algorithm 3 Algorithm 100 integers 200 integers 300 integers

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions

Question

6. Discuss the steps involved in conducting a task analysis.

Answered: 1 week ago