13. List all the steps used to search for 9 in the sequence 1, 3, 4, 5, 6, 8, 9, 11 using a) a linear search. b) a binary search.
14. List all the steps used to search for 7 in the sequence given in Exercise 13 for both a linear search and a binary search. 15. Describe an algorithm that inserts an integer x in the ap- propriate position into the list a1, a2, ..., an of integers that are in increasing order. 18. Describe an algorithm that locates the last occurrence of the smallest element in a finite list of integers, where the integers in the list are not necessarily distinct. 24. Describe an algorithm that determines whether a func- tion from a finite set to another finite set is one-to-one. 32. Given n real numbers x1, x2, .., Xn, find the two that are closest together by a) abrute force algorithm that finds the distance between every pair of these numbers. b) sorting the numbers and computing the least number of distances needed to solve the problem.