Question: QUESTION 22 Assume we do not have variable size that tracks number of elements in SinglyLinked list, what will be the complexity of method size()




QUESTION 22 Assume we do not have variable size that tracks number of elements in SinglyLinked list, what will be the complexity of method size() in this case? O O(n^2) Odlog n) O(1) O(n) QUESTION 21 The insertion sort algorithm works by partitioning the unsorted portion of the array into two sublists and sorting the two sublists. repeatedly locating the smallest value in the unsorted portion of the array and moving it toward the lower end of the array repeatedly taking the first value in the unsorted portion of the array and placing it at its proper place in the part of the array that is already sorted. repeatedly comparing adjacent items and swapping them so smaller values come before larger values QUESTION 20 The complexity of binary search is : O O(n2) O O(Log n) O 0(1) O(n) The selection sort algorithm works by repeatedly comparing adjacent items and swapping them so smaller values come before larger values O repeatedly locating the smallest value the unsorted portion of the array and moving it toward the lower end of the array repeatedly taking the first value in the unsorted portion of the array and placing it at its proper place in the part of the array that is already sorted. partitioning the unsorted portion of the array into two sublists and sorting the two sublists. O
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
