Shell sort is a generalization of insertion sort that allows exchanges of items far apart. It makes multiple passes over the list with gap sequences, where each pass uses a smaller gap than the previous. On each pass, it sorts elements spaced apart by that gap using an insertion sort approach. While slower than other O(n log n) sorts, it is faster than other O(n^2) sorts and can be implemented with little code.