Sorting algorithms C++ implementation Selection sort Efficiency: always O(n2). No practical usage. Insertion sort Efficiency: average and worst case O(n2). It's good for almost sorted and short sequences (less than 50 elements). Bubble sort Efficiency: average and worst case O(n2). No practical usage.