These are the solutions to the three assignments in my Advanced Algorthm Desgin Class(CS3050).
- The first assignment was to create an algorithm that returns a random integer from a given random integer array without knowing the size of the given array. We were required to do this in O(n) time, and create a function that proves that every value in the array has an equal chance of being selected.
- The second assignmnet was to create a Random Binary Search tree that can be built in O(nlogn) time. We were given an array of integers, and each integer had to have an equal chance of being the root node of the tree. I used a similar implementation to assignment one for this specific function. We also had to create functions that tested to make sure our functions had the correct complexity. Our free function had to be O(n) and our insert funtion had to take O(nlogn) to build a tree. We also had to test to make sure each integer had an equal chance of being selected to be the root node of the entire tree.
- The third assignment was creating an algorithm that could find the widest seperated pair in an unsorted array of doubles. This function had to have O(n) complexity, and we again had to use a function to prove that our function had the correct time complexity.