| CS 261 | University of Puget Sound | Spring, 2020 |
|
Computer Science II
|
||
|
Abstract Data Types and their Implementations,
Some Basic Algorithms,
Object-oriented Problem Solving, and Efficiency |
||
Warning:
This course is under development.
Although the basic structure of this course is largely established,
nothing on this Web site should be considered official or even possibly
correct.
DO NOT MAKE PLANS BASED ON THE CONTENTS OF THIS SITE UNTIL JANUARY, 2020.
This laboratory continues work with the use of lists and pointers.
This lab utilizes work done in the previous lab with the classes ListStringNode and NameList.
OrderedNameList class that extends
NameList.
The underlying theme for this lab is that OrderedNameList will
also be a list of names, except in this case the names will be stored
in dictionary order.
Change the insert method, so that each new node is inserted so that the resulting list remains in dictionary order.
Note: Since insertion must maintain a specified ordering, there is no need to ask the user where to place a new item.
With order specified, finding the first name on the list is particularly easy. Revise the findMinimum method accordingly.
Similarly, update findIndex, so that the method will be as efficient as possible (e.g., to determine an item is not present on the list).
If a list is to remain ordered, a putFirst ( ) method is no longer appropriate.
OrderedNameList, what happens
if putFirst is called (e.g.,
in main)?
OrderNameList class.
|
created 28 January 2020 by Henry M. Walker revised 29 January 2020 by Henry M. Walker |
|
| For more information, please contact Henry M. Walker at walker@cs.grinnell.edu. class="footer-a"tr> |