searching and sorting algorithms using python