Starting from:

$30

Assignment 3 MaxStack data structure

Assignment 3


1) The problem is similar to Exercise 3.14 in the textbook, except that you will implement the MaxStack data structure (and NOT the MinStack data structure).

The MaxStack data structure must support the stack operations push(x), pop() and size() in constant time. It must also support the max() operation that returns the current maximum element in the data structure in constant time.

Note: The data stored in the data structure must be comparable. That is, the data type must implement the Comparable interface. The ordering defined by the compareTo() method dictates what "max" means here. For Integers and Strings it is the normal ordering.


Submit
======

Submit a single zip file that has in it a directory called comp2402a3. Your MaxStack.java file should be in this file. Do NOT submit .class files or any other files. Do not submit the SLListStack.java or Factory.java files (and be sure to NOT modify your version of these files!).

Once the submission server is running you may submit as many times (there will be delays if you submit too often) before the deadline. DO NOT wait until 11:59am on Wednesday to submit.

More products