CSSE 220 – Object-Oriented Software Development
Homework 25 for Delvin’s Section
Objectives
Continue working with your teammates on your project.
Practice writing search algorithms in the context of a mobile environment.
Tasks
-
Complete the assigned reading for the next session, according to the course schedule.
- As you read, see if you can answer the self-check questions.
- Bring your questions to class!
-
Complete the assessment exercise over this reading on ANGEL (under
Lessons → Assignments).
- Delvin’s Section Only:
- If you have not completed your installation of the Java
Wireless Toolkit, follow
these instructions to do so.
- Be sure to configure Eclipse for J2ME development.
Instructions on how to do so are available at
this location.
- In the TextTwisterMIDlet project that you checked out in class, complete the
TODO
items in numbered order.
- Suppose you were asked to extend this game to include
8-letter words. 8-letter words require a large number
(3-, 4-, 5-, 6-, and 7-letter words) words to be searched.
When the search space increases, the searching algorithm
needs to be more efficient.
- Which of the two searching algorithms we
discussed in class would be better suited
for the search space generated by 8-letter
words?
- Briefly describe what changes you
would make to allow your project to support
8-letter words. Note that J2ME does
not provide support for ArrayLists or
Generics. However, it does support the use
of Vector types. Include a brief
discussion of vectors in your description.
- A "haystack search" checks for the
value at the ends of the array. If the value
is not found there, the strategy just keeps
choosing an index at
random until it finds the right spot.
Implement and plug in a
HaystackSearchStrategy class in your
TextTwisterMIDlet project. For this
implementation, we will suspend the search
after n-squared attempts to guess the
correct index of the search value if the
value is not found. The algorithm will
assume that the value is not in the array
and return -1. Otherwise, it returns the
index of the value.
- Team Assignment: Working with your team, complete the assigned milestone of the Vector Graphics project.
Turn-in Instructions
Add your answers to questions 2.d.(i., ii.) in the writtenAnswers.txt
file in your TextTwisterMIDlet project.
Commit your work on the TextTwisterMIDlet project to SVN.
See the Vector Graphics assignment description for team project deliverables.