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 task, 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.
Do not count array.length as an array access. 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.
TODO
items in sorting.FunctionObjectsExample
.
writtenProblems.txt
, in the SortingAndSearching
project in Eclipse. Edit the file to answer to the questions that you’ll find there.
Turn in your individual work by committing it to your SVN repository.
See the Vector Graphics assignment description for team project deliverables.