Total = 30 marks (write your answer inside the textbox provided, otherwise it will NOT be graded)
NOTE: for each question, write exact answer (do NOT write in terms of big-O).
Algorithm
Question
Sorted array
of size n
Reversely sorted
array of size n
Given array A =
[1, 3, 2, 6, 7, 8, 9, 4]
Insertionsort Exactly how many times
the outer loop will run?
Exactly how many times
the inner loop will run?
Original
Bubblesort Exactly how many times
the outer loop will run?
Exactly how many times
the inner loop will run?
Exactly how many times
the Exchange takes
place?
Modified
Bubblesort Exactly how many times
the outer loop will run?
Exactly how many times
the inner loop will run?
Exactly how many times
the Exchange takes
place?
Mergesort Exactly how many times
Mergesort is called?
Exactly how many times
Merge is called?