Sorting program I adapted to work in python

took a program I wrote years ago in java and made it work in python