Big O SECTION List Appropriate Worst Case Big O Notation under the different alg
ID: 3862195 • Letter: B
Question
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
Answers:
A.Quicksort Recursive Algorithm on an Array of 100,000 elements = O(n log n)
Explanation: Average time complexity of quicksort is O(n log n).
B.Binary Search on sorted array of 100,000 elements=O(log n)
Explanation: Average time complexity of Binary Search is O( log n).
C. Iterating over an array = O(n)
Explanation:For iterating the whole array we need to visit each index.
D. Deleting last element in an array of 10 elements = O(1)
Explanation:on index basis the last element could be deleted directly.
E. Accessing first element in Array of 1,000,000 elements = O(1)
Explanation:on index basis the first element could be accessed directly.
Note:Please do ask in case of any doubt,Thanks.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.