Start developing an intuition for algorithm analysis. Experiment with sorting and searching.
For this tasks, you’ll be working in the Loops
class of the counting
package. For each method in that class, add a comment stating how many times the array variable is accessed in the best and worst cases. Give your answers as closed form formulae in n, the length of the input array. One of the comments is given as an example.
You may add profiling code if you wish, but should not change the behavior of the given methods.
sortAndSearch
package.
MergeSort
program there and experiment with it. compareTo()
gets called and perform the big-Oh analysis of the running times. Enter your answer as a comment at the end of the program. writtenProblems.txt
file in the project directory. Remember, in all your code:
Here is the grading rubric for this assignment.
Turn-in your individual work by committing it to your SVN repository.