Question: A.1. Modify(A) J 5 For i=0 , i=A.length-1 , i++ IF A[i] = odd A[i] A[i]+A[i+1] A[i+1] A[i] A[i+1] A[i] A[i+1] A[i] Else A[i] A[i]+J

 A.1. Modify(A) J 5 For i=0 , i=A.length-1 , i++ IF

A.1.

Modify(A)

J 5

For i=0 , i=A.length-1 , i++

IF A[i] = odd

A[i] A[i]+A[i+1]

A[i+1] A[i] A[i+1]

A[i] A[i+1] A[i]

Else

A[i] A[i]+J

J++

EndIF

EndFor

EndAlg

moodle.griffith..e a Given an Array BI] consisting of N elements, use pseudocode to describe how Bubble Sort would be performed. (8 marks) b) The table below displays an array of animal types being sorted. Column A = the starting Array, Column G shows the final, sorted, order. The columns in between show different sorting algorithms (listed below) at different stages of the sorting process. Identify which sorting algorithm produced which: A: Start B End vark le cat vark horse Cit at ark horse lephant horse le dvark cat ctopus Octopus le Squid le Octopus Squid TO Algorithm list: HeapSort(Max) BubbleSort, MergeSort, InsertionSort, SelectionSort, (10 marks) e) The Pseudocode in Appendix A.1 will fail if run as is. Correct edit) and apply the function to the the issue (requires following Array: 11 142721 22 196 Write out the final Array values when the algorithm has completed (7 marks) Total (25 marks)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!