Algorithm that finds a stable matching between two equally sized sets of elements given an ordering of preferences for each element.