Programming Assignment 1 (due midnight 07/23/14)
Penalty for late
submission: 10% less credit/day.
Problem I (50 points). Implement, document (i.e. provide specifications), and test
the following functions in Scheme. Scheme has implemented some of the
constructs below (iota, association lists) - you may not use these
implementations, but rather must implement them yourself. Make sure all
functions are thoroughly tested.
Problem II (50 points). Prepare a framework for timing BST search operation applied to random BSTs implemented in C++, Scheme and ML, perform a series of timing experiments and draw conclusions out of your experiments. Mark’s website contains examples explaining how to perform timing in Scheme and ML. CS 265 website (https://www.cs.drexel.edu/~knowak/cs265_spring_2014/cs_265_links.htm) contains code (https://www.cs.drexel.edu/~knowak/cs265_spring_2014/code_part_1.zip) and explanations related to random C++ BSTs.
1. Write
C++/Pyton
code that prompts the user for an input integer n, creates a vector/list
consisting of numbers 0,1,2,…,n-1, runs the STL/Python library algorithm
random_shuffle/random.shuffle on it in order to create a random permutation
of size n and then stores it in a file.
2. Write
C++, Scheme and ML code that reads a random permutation from a provided file
and then inserts its numbers one-by-one into an initially empty BST. Once the
BST is created the code should compute its height, the number of nodes and the
total time spent on searching for all of its items.
3. Run a series of representative timing experiments, report them in the form of a table or graphs, draw your conclusions, write them down and submit together with your code.
You will need to submit your code and reports following the submission rules
that will be provided at a later date.