Question 1. Show in the style given in the class, how the last 5 digits of your student number (e.g. 123456789) will be

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Question 1. Show in the style given in the class, how the last 5 digits of your student number (e.g. 123456789) will be

Post by answerhappygod »

Question 1. Show in the style given in the class, how the last 5digits of your student number (e.g. 123456789) will be sorted usingthe following sorting algorithms- Please make sure to change thesedigits to be unique digits:
a. Selection sort-[5 Marks]
b. Insertion sort-[5 Marks]
c. Quick sort-[5 Marks]
d. Merge sort [5 Marks]
e. Bubble sort-[5 Marks]
f. heap-sort (min-heap)-[5 Marks]
Question2. Write a program in C, which compares the performanceof 4 sorting algorithms. Each algorithm sorts n numbers from aninput file containing a list of numbers. Each program then sorts nnumbers and prints the numbers to a file. You Should use theimplementations of the sorting algorithms from the class notes.
1. Insertion sort algorithm(G1).
2. Selection sort algorithm(G2).
3. Quick sort algorithm(G3).
4. Heap-sort algorithm (G4).
b. Dataset 1: Run your program on values from 1 to n where n=10,000 (i.e. input numbers are sorted and there is no need to readfrom an input file). Print the execution time on the screen withwell explained messages for each algorithm.
c. Dataset 2: Read in the first 10,000 entries only found in“test_dat.txt” and Run your program. Print the sorted input andexecution time to 4 output files called (G1.txtx, G2.txt, G3.txtx,G4.txt)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply