insertion and selection sort sample code