Sorting Algorithms Bubble sort • Compare each element (except the last one) with its neighbor to the right – If they are out of order, swap them – This puts the largest…
Computer Science 101 Fast Algorithms What Is Really Fast? n O(log2n) O(n) O(n2) O(2n) 2 1 2 4 4 4 2 4 16 64 8 3 8 64 256 16 4 16 256 65536 32 5 32 1024 4294967296 64 6 64…