Q 3 0 10 Marks Q 2 C 4 Marks Explain Best Case Time Complexity Quick Sort O N Logn Travel Q43809064
Q 3(0) [10 Marks] Q 2(c) [4 Marks] Explain why the best-case time complexity of Quick Sort is O(N logN). In a Travelling Salesman Problem (TSP), the 2-opt tour improvement method is to be used to reduce the length of the approximate tour solution shown below. Assume edges (c,d) and (e, f) have been selected for removal. Q 2(d) [6 Marks] o e The items below are to be sorted by Selection Sort. Write down the array after each exchange (swap) operation of the Selection Sort algorithm, until the array is sorted. (6 exchanges will be required to sort the array). fo——- – – – ob { 12, 4, 9, 15, 2, 8, 3, 25 } Q 2(e) [4 Marks] What is the worst-case time complexity of Insertion Sort? Explain when the worst- case can occur. (a, b, c, d, e, f, a) [End of Question 2] Explain how the 2-opt step functions and explain, with the aid of a diagram, how the 2-opt step will replace edges (c,d) and (e, f) with two new edges. [End of Question 3] Show transcribed image text Q 3(0) [10 Marks] Q 2(c) [4 Marks] Explain why the best-case time complexity of Quick Sort is O(N logN). In a Travelling Salesman Problem (TSP), the 2-opt tour improvement method is to be used to reduce the length of the approximate tour solution shown below. Assume edges (c,d) and (e, f) have been selected for removal. Q 2(d) [6 Marks] o e The items below are to be sorted by Selection Sort. Write down the array after each exchange (swap) operation of the Selection Sort algorithm, until the array is sorted. (6 exchanges will be required to sort the array). fo——- – – – ob { 12, 4, 9, 15, 2, 8, 3, 25 } Q 2(e) [4 Marks] What is the worst-case time complexity of Insertion Sort? Explain when the worst- case can occur. (a, b, c, d, e, f, a) [End of Question 2] Explain how the 2-opt step functions and explain, with the aid of a diagram, how the 2-opt step will replace edges (c,d) and (e, f) with two new edges. [End of Question 3]
Expert Answer
Answer to Q 3(0) [10 Marks] Q 2(c) [4 Marks] Explain why the best-case time complexity of Quick Sort is O(N logN). In a Travelling…
OR