1.a. Suppose you must sort a list of ten integers in descending order, and you have already designed an algorithm that does this for six integers. Design an algorithm to sort ten integers by taking advantage of the previously designed algorithm.
b. Design a recursive algorithm to sort arbitrary lists of integers in descending order based on the technique used in (a).
2.Develop two algorithms, one based on a loop structure and the other on a recursive structure, to print the daily salary of a worker who each day is paid twice the previous day’s salary (starting with one penny for the first day’s work) for a 30-day period. What problems relating to number storage are you likely to encounter if you implement your solutions on an actual machine?
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here