QUESTION 10 What does the following function f do? (a is an array, n is the size of the array) void f(int all, int n) {
Posted: Sat May 14, 2022 4:58 pm
QUESTION 10 What does the following function f do? (a is an array, n is the size of the array) void f(int all, int n) { int i; for (i=0;i<n;i++) swap(a, a[n-i-1]); 1 It reverses array a. It makes NO change to array a. It shifts all the numbers by 1. It swaps the first and the last elmenet of array a. QUESTION 11 Which of the following sorting algorithms requires most amount of additional memory? merge sort quick sort selection sort insertion sort QUESTION 12 Which of the following sorting algorithms has the best best case complexity? merge sort insertion sort selection sort quick sort