SE 765 -
Distributed Software Development (CRN 73169) |
CS 610 -
Introduction to Parallel and Distributed Computing (CRN 73173) |
Assignment #3
Exercise 1
Write an Erlang module to perform a binary search on a sorted list of numbers at least 10 values in length. The module should return the position of the number if it is found or a statement that it is not contained in the list. Demonstrate the module by calling it from the Erlang shell, passing the list of values to the module.
(There are many explanations of a binary search on the web. One such explanation is found here: (http://www.algolist.net/Algorithms/Binary_search )
Exercise 2
Write an Erlang module to perform an insertion sort for a list of numbers at least 6 values in length. The module should return the ordered list. Demonstrate the module by calling it from the Erlang shell, passing the unordered list to the module.
(There are many explanations of the insertion sort on the web. One such explanation is found here: http://www.algolist.net/Algorithms/Sorting/Insertion_sort)
Exercise 3
Write an Erlang module to
implement the Tower of Hanoi problem. Demonstrate the module by calling it from
the Erlang shell.
There are many explanations of the Tower of Hanoi on the web. Here are some:
http://www.chessandpoker.com/tower-of-hanoi.html
http://en.wikipedia.org/wiki/Tower_of_Hanoi
Note:
· All programs must be your own work.
· As with Assignment #2 send the .erl and a screen capture of each program executing to me.
· Due date: 6 PM, Monday, November 12, 2012