SE 765 - Distributed Software Development

CS 610 - Introduction to Parallel and Distributed Computing

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)

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.