CS 474 - Machine Problem 2

Inheritance of Linear Data Structures

Due: 11:59 pm on Wednesday 11/5/2003

For this assignment you must work alone.

For this assignment, you must implement four linear data structure using linked lists in Smalltalk. All four of these data structures are to be connected in some inheritance hierarchy. Therefore you are not allowed to create 4 complete separate data structures for this assignment. Any assignment doing this will receive a zero for the assignment.

The following shows the data structures and the operations to be performed.

  1. a unordered sorted list
  2. a sorted list in increasing order
  3. a queue
  4. a stack

This project must have a GUI that shows 4 different lists. The data structure with each list can vary during the execution of the program. A combo-box like element should be used to select the type of data structure associated with each list. The GUI should show the values in the data structure with the first (left-most) value being the value pointed to by the head of the list. At least the first 10 values should be shown. The remaining items should be viable using some scrollable functionality. The operations to be performed should also use a combo-box like element. The result of any operation should be displayed on the GUI.

One example of how the GUI could be constructed is shown below. Note that the example is created using JavaScript elements, so making the exact same thing in Smalltalk may not look the same.

List 1: has elements.
Pos: 1234 5678 9101112
Value:14517-2
Operation:   Result:  

List 2: has elements.
Pos: 1234 5678 9101112
Value:-275114
Operation:   Result:  

List 3: has elements.
Pos: 1234 5678 9101112
Value:457652
Operation:   Result:  

List 4: has elements.
Pos: 1234 5678 9101112
Value:-271451
Operation:   Result:  

The following is to clarify any of the operations.

General Comments

Your program must be written in good programming style. This includes (but is not limited to) meaningful identifier names, a file header at the beginning of each source code file, a function header at the beginning of the function, proper use of blank lines and indentation to aide in the reading of your code, explanatory "value-added" in-line comments, etc.

The work you turn in must be 100% done by your own own. You are not allowed to share code with any other students (inside this class or not). You may discuss the project with other students; however, you may not show any code you write to another student nor may you look at any other student's written code.