What is the efficiency of insertion sort - what is the base


Regarding the JAVA langauge consider the following questions about sorting:

1: What is the efficiency of insertion sort? (pick one) a. O( n ) b. O(n2) c. O(1) d. O(n logn)

2: Consider selection sort and insertion sort and how much memory these algorithms need in proportion to the size of the array. In other words, do not consider memory required for single variables or looping variables, only memory that is directly proportional to the array. Which of the following is true? (pick one) a. selection sort requires more additional memory than insertion sort. b. insertion sort requires more additional memory than selection sort. c. both selection and insertion sort require the same amount of additional memory. d. neither selection nor insertion sort require additional memory.

3: What is the base case for the recursive merge sort algorithm? (pick one) a. any array that is already sorted. b. a one-element array. c. a zero-element array. d. a two-element array.

4: What is the efficiency of merge sort? (pick one) a. O(1) b. O(n logn) c. O(log n) d. O( n ) e. O(n2)

5: Which of the following sorting algorithms is the fastest? a. selection sort. b. insertion sort. c. merge sort. d. they all run at roughly the same speed.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: What is the efficiency of insertion sort - what is the base
Reference No:- TGS01528522

Now Priced at $10 (50% Discount)

Recommended (90%)

Rated (4.3/5)