Question: Q1. (a) Suppose that a binary search is made through an ordered list L, of length 20, for an item X, which tlyi e .leanyae

Q1. (a) Suppose that a binary search is made through an ordered list L, of length 20, for an item X, which tlyi e .leanyae ale i. in the best case scenario? ii. in the worst case scenario? iii. in the average case scenario (for this part- your answer might not be an integer)? [11 marks] (b) Write down the intermediate words that are constructed after each iteration when the letters in the word "gdansk" are alphabetically ordered using i. bubble sort 11. quicksort 12 marks] (c) Calculate the computational complexity (in "Big Oh" notation) of the bubblesort algo- rithm. [10 marks
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
