Implementation of Ko-Aluru SA sorting algorithm in Python 2.7.3