what is time complexity
time complexity of an algorithm describes how time taken to execute it grows with the size of the input data
- time complexity does not indicate actually performance
linear search, insert remove
search: O(1)
insert: O(n)
remove: O(n)
linked list search, insert remove
search: O(n)
insert: O(1)
remove: O(1)
binary search, insert remove
search: O(log(n)); worse case (O(n))
insert: O(log(n))
remove (leaf node/ one child node): O(1)
remove (two-child node): O(log(n))