December
1999 QUESTION 4 Total Marks: 15 Marks |
Click here to access other
questions
Click to access |
(a) |
Briefly describe the selection Sort algorithm.
|
[2] |
(b) |
When a list of size N is sorted by selection sort, how many passes of the list are required to ensure the list is sorted?
|
[1] |
(c) |
Given the unsorted list x below, show the state of the list after each pass of a descending selection sort. x =[2 ,6 ,13 ,7 ,12 ]
|
[4] |
(d) |
Assume the following definition of a dynamic linked list:
Write a procedure DescendingSelectionSort , the signature of which is given below, which takes an unsorted list of the type given above and performs a descending selection sort on the list.You may assume the existence of the procedures and functions whose signatures are given above. PROCEDURE DescendingSelectionSort(VAR x : List); |
[8] |