0% found this document useful (0 votes)
16 views1 page

Week 10 11 Sorting (1043)

The document discusses an assignment on data structures and algorithms involving sorting. Students are asked to implement 9 sorting algorithms, run them on 5 input files of varying sizes, measure runtime, and plot the results on a graph with runtime on the y-axis and number of entries on the x-axis.

Uploaded by

raufafzal29
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views1 page

Week 10 11 Sorting (1043)

The document discusses an assignment on data structures and algorithms involving sorting. Students are asked to implement 9 sorting algorithms, run them on 5 input files of varying sizes, measure runtime, and plot the results on a graph with runtime on the y-axis and number of entries on the x-axis.

Uploaded by

raufafzal29
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Weeks 10 and 11: Data Structures and Algorithms

Q1 Q2 Q3 Total
Sorting
(3 × 9) = 27 3 + 20 = 23 10 60

Do the following reading prior to doing this assignment:

Lecture Topics Reading

21 – 26 Sorting https://drive.google.com/file/d/19g07m0WDR3E0XNnPi_ogoXaxr6vKGsgx/view?usp=sharing

Q1) Write a program that implements and compares several Sorting algorithms

S. No. Program Details Marks


1 Functions:
[1] Selection_sort ( ). (3)
[2] Bubble_sort ( ) (3)
[3] insertion_sort ( ) (3)
[4] merge_sort ( ) (3)
[5] quick_sort ( ) (3)
(3)
[6] heap_sort ( )
(3)
[7] radix_sort ( ) (3)
[8] count_sort ( ) (3)
[9] bucket_sort ( )

2 A main( ) function that


[1] Calls upon an external file containing a list of numbers (“input1.txt”). (3)
[2] Evaluates the total number of numbers present in the input file. (5)
[3] Sorts the list of numbers using all the (9) sorting algorithms enlisted in (Q1). (5)
[4] Evaluates the run-time for each sorting algorithm. (5)
[5] Prints the time-taken by each sorting algorithm in increasing order of magnitude. (5)

3 [1] Repeat Q2 for the five files attached i.e., “input2.txt” to “input5.txt.” (5)
[2] Plot the results using a graph, where the Y-axis represents the time taken in seconds, (5)
whereas, the x-axis represents the number of entries in each input file (in increasing
order). You may use the logarithmic scale log10 () for the x-axis. Make sure you use a
different colour for each sorting algorithm.

Rubrics (Associated Marks)

S. No. Content Meets Criteria (1) Marks Does not meet expectations (0) Marks

1 Indentation Perfect 100% Code not indented properly 0


2 Code works Code compiles and executes properly for 100% Code has errors Based on
any variable sized matrices the code

3 Comments Code is properly commented 100% Code is not properly commented. 0

Copyright © 2022, Dr. Bilal Wajid

You might also like