What are time complexities of sorted array operations?

Technology CommunityCategory: ArraysWhat are time complexities of sorted array operations?
VietMX Staff asked 3 years ago

sorted array is an array data structure in which each element is sorted in numerical, alphabetical, or some other order, and placed at equally spaced addresses in computer memory.

Time complexity of operation on a sorted array:

Algorithm Average Worst case
Space O(n) O(n)
Search O(log n) O(log n)
Insert O(n) O(n)
Delete O(n) O(n)