Ordered Arrays: Advantages and Disadvantages
Search is faster, insertion is slower (deletion and insertion are slow in both ordered an unordered)
Logarithms
log base 2 of n is the number of times it is required to divide n by 2 to get 1.
Big O: Insertion into an unordered array
O(1)
Big O: Linear search
O(n)
Big O: Binary search
log(n)
Why not use arrays for everything?
Insertion into an unordered array takes O(1), but searching takes O(n), for an ordered array, insertion takes O(n) and searching O(logn). For both unordered and ordered, deletion takes O(n) time.
Operations on arrays
Insertion, deletion, and searching