Start developing an intuition for algorithm analysis. Experiment with sorting and searching. More design practice.
SortingAndSearching
project inside Eclipse. Use the
SVN Repository Exploring
perspective to check out this project, then switch back to the
Java
perspective.
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
count
variable is incremented 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.
sortExercise
package.
sort()
method.
combine()
method does.
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.
Turn-in your individual work by committing it to your SVN repository.
See the Dam Beavers assignment description for team project deliverables.