A 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) |