C++ Big O SECTION List Appropriate Worst Case Big O Notation under the different
ID: 3862115 • Letter: C
Question
C++
Big O SECTION List Appropriate Worst Case Big O Notation under the different algorithms or data structure operations. Choose from right column and place under left column. Right column can be used more than once or not all.
A. Quicksort Recursive Algorithm on an Array of 100,000 elements
O(1)
B. Binary Search on sorted array of 100,000 elements
O(n)
C. Iterating over an array
O(n^2)
D. Deleting last element in an array of 10 elements
O(log n)
E. Accessing first element in Array of 1,000,000 elements
O(n log n)
A. Quicksort Recursive Algorithm on an Array of 100,000 elements
O(1)
B. Binary Search on sorted array of 100,000 elements
O(n)
C. Iterating over an array
O(n^2)
D. Deleting last element in an array of 10 elements
O(log n)
E. Accessing first element in Array of 1,000,000 elements
O(n log n)
Explanation / Answer
A)O(n^2)//
B)O(logn)//every times it leaves half of the list
C)O(n)//to iterate we have to traverse all elements of list
D)O(1)// just access using index
E)O(1)// just access using index
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.