This assignment is Homework 19, and is due at classtime on Wednesday, April 12.
Write a recursive function that prints the sequence of moves necessary to solve the Tower of Hanoi problem.
Specifically, your program should first ask the user for a number of disks, and then print the sequence of moves required to move the stack of disks from post 1 to post 3. Recall that only one disk may be moved at a time, and a large disk may not be placed on top of a smaller disk. Assume disk 1 is smaller than disk 2, which is smaller than disk 3, and so on.
For example, the Python console might look something like this when you run your program:
How many disks? 2
Move disk 1 from post 1 to post 2
Move disk 2 from post 1 to post 3
Move disk 1 from post 2 to post 3
DONE
Write a function that implements the binary search algorithm to search for an item in a sorted list.
Your function header should be:
def binarySearch(alist, item):
This function requires that the list alist be sorted in ascending order. The function returns True if item is in the list alist, and False otherwise.
Recall the binary search algorithm from class:
You must write a recursive algorithm to receive full credit.
After you have finished your solutions, paste them into a single Python file. Make sure that Python can run your file without error! Please use comments (lines that begin with a # symbol) to clearly state the problem number for each solution in your file. Save your file and upload it to the HW19 assignment on Moodle.