two versions of selection sort: basic and improved on with index