Highlights
TASK:
Question 1 (18 marks) a) An algorithm takes 1 seconds to handle a data set of 1,000 items. How long does it take the algorithm to handle a similar data set of 100,000 items?
i) If the complexity is O(n)
ii) If the complexity is O(1)
iv) If the complexity is O(log n) [6 marks]
b) Suppose we apply the binary search to search for a given element in an array that has 1,000 elements.
i) In the worst case, how many comparisons does it take to search for an element that is in the array?
ii) In the best case, how many comparisons does it take to search for an element that is in the array? [4 marks]
3 c) Describe the following functions in terms of the Big-Oh notation. i) f(n) = n + 3log n ii) f(n) = 3 + 2n + n 3 [4 marks]
d) Consider the following method which computes an . In terms of the Big-Oh notation, what is the efficiency of the method? Justify your answer with the sequence of recursive calls for power(a, 16). public static double power(double a, int n) // n is a non-negative integer { if (n== 0) { return 1; } else if ( n % 2 == 0) // n is even { double p = power(a, n/2); return p * p; } else // n is odd { double p = power(a, n/2); return p * p * a; } } [4 marks] 4
Question 2 (24 marks) a) a: 10 8 2 6 4 Perform the bubble sort algorithm on the array above, and show the array after each pass. The tracing can be done in any way you like. [8 marks] b)
a: 10 8 2 6 4 Perform the selection sort algorithm on the array above, and show the array after each pass. The tracing can be done in any way you like. [8 marks]
c) a: 10 8 2 6 4 Perform the insertion sort algorithm on the array above, and show the array after each pass. The tracing can be done in any way you like.
This IT Assignment has been solved by our IT experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.
Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.
© Copyright 2026 My Uni Papers – Student Hustle Made Hassle Free. All rights reserved.