Lab Assignment 15: Auto Complete Analysis
Overview
This week you will perform asymptotic time complexity analysis and benchmark all of your implementations from previous weeks. The assignment this week is focused on summarizing what you have learned in the previous weeks and drawing conclusions on how the various data structures used in this project behave.
Details
O() Analysis
Create a PDF document and provide O() analysis for
the exactMatch() and allMatches() methods defined in the
AutoCompleter interface for all your implementations. Your analysis
should include separate results for the Unordered and Ordered Lists backed by
both an ArrayList and a LinkedList as well as your Binary Search Tree and Trie implementations. In your analysis,
use n to represent the number of elements in the AutoCompleter and
m to represent the number of elements in the array returned by
allMatches(). Be sure to clearly explain your reasoning.
AutoCompleter interface
There is a new static method, getString(int length), that returns a String
with length randomly selected lowercase letters in it. This method will
be used to generate word lists to be used in your benchmarking
activities.
Benchmarking Program
The Benchmarker program collects data to characterize the performance of
add(), exactMatch(), and allMatches() methods defined in the
AutoCompleter interface as a function of input size. Generate data and plot the
results for each of your implementations in a separate graph (UnorderedList (ArrayList and LinkedList),
OrderedList (ArrayList and LinkedList), Binary Search Tree, Trie). Be sure to collect
enough data so that your graphs clearly show the growth rate of
each algorithm. After each graph, explain how your code matches the growth rate you have plotted.
Reflection on Learning
In the final section of your report, address the following:
- What questions would you try to answer in order to improve your understanding of this project?
- Describe your greatest strength with respect to this course.
- Describe an area related to this course where you believe you could improve.
- Give an example of a software project you think would be valuable that you believe you could now implement.
Just For Fun
Ambitious students may wish to:
- Benchmark the
allNonPrefixMatches(String substring)method that was added to the interface. - Implement the
Trieusing an array as the backing structure, setting the length to 26 and using the indexes as "hash" values for each character.
Acknowledgement
This laboratory assignment, developed by Dr. Chris Taylor.