This cheat sheet illustrates the notation and description of time complexity with example code. Each is written in order of lowest to highest complexity and colour coded from O(1) green to O(2^n) red for easy reference.
The best, average and worst time complexity is shown for the linear search, binary search, hash table / dictionary search, depth and breadth first searches.
The best, average, worst time complexity and space complexity is shown for the bubble sort, insertion sort, merge sort and quick sort.