?

AP® Computer Science A

Free Version

Upgrade subject to access all content

Moderate

Insertion Sort Run Time

APCSA-J1VWTB

What is the best case and worst case run times for an INSERTION SORT?

O represents big-O notation and n is the number of elements in the array or list.

A

best case: O(n), worst case: O(n-squared)

B

best case: O(n), worst case: O(n)

C

best case: O(n-squared), worst case: O(n-squared)

D

best case: O(n log n), worst case: O(n log n)

E

best case: O(1), worst case: O(n-squared)