Question: boolean is _ sorted ( lyst ) : This is a predicate function that returns True if lyst is sorted, False otherwise. In addition to
boolean issortedlyst: This is a predicate function that returns True if lyst is sorted, False otherwise. In addition to verifying that lyst is a list, issorted must also verify that every element in the list is an integer. If lyst is not a list, or a noninteger element is found in it issorted should raise a TypeError exception. Note: We recommend implementing this function first, so that you can use it to do unit testing as you develop your sorting functions.
list int, int quicksortlyst: This function implements the quicksort algorithm to sort the items in lyst the function returns a tuple containing the sorted list, followed by the number of comparisons, and finally the number of swaps performed while sorting. lyst must be a Python list containing comparable data ie things that the etc. operators can be used on to determine an ordering between two items If lyst is not a list, quicksort must raise a TypeError Exception.
list int, int mergesortlyst: This function implements the mergesort algorithm to sort the items in lyst the function returns a tuple containing the sorted list, followed by the number of comparisons, and finally the number of swaps performed while sorting. lyst must be a Python list containing comparable data ie things that the etc. operators can be used on to determine an ordering between two items If lyst is not a list, mergesort must raise a TypeError Exception.
list int, int selectionsortlyst: This function implements the selection sort algorithm to sort the items in lyst the function returns a tuple containing the sorted list, followed by the number of comparisons, and finally the number of swaps performed while sorting. lyst must be a Python list containing comparable data ie things that the etc. operators can be used on to determine an ordering between two items If lyst is not a list, selectionsort must raise a TypeError Exception.
list int, int insertionsortlyst: This function implements the insertion sort algorithm to sort the items in lyst the function returns a tuple containing the sorted list, followed by the number of comparisons, and finally the number of swaps performed while sorting. lyst must be a Python list containing comparable data ie things that the etc. operators can be used on to determine an ordering between two items If lyst is not a list, insertionsort must raise a TypeError Exception.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
