subject

A. Create ArrayIntStack. java (one that's REALLY O(constant), totally!!!) B. Create the Javadoc web page (separate Assignment #15b).
C. Create your own Stack Class, call it ArrayIntStack. java and write the standard four public Stack methods as listed below (this is the easy part of the assignment). Use at least one private helper method, maybe to ensure capacity of the array. All methods in your ArrayIntStack must have O(constant) run-time. Your ArrayIntStack extends no other Classes from the Java API. You must provide a default constructor.
1. boolean empty(); Tests if this stack is empty (watch spelling here, as I will)
2. int peek(); Looks at the object at the top of this stack without removing it from the stack.
3. int pop(); Removes the object at the top of this stack and returns that object as the value of this function.
4. int push(int item); Pushes an item onto the top of this stack, return what was pushed.
Additional methods, code, etc... will also need to be provided, so the client can use an iterator:
5. public class IntStackIterator { // similar to what the BJP authors show, but without a remove() implemented
6. public IntStackIterator iterator() method so the client can browse through the data with .next() etc... Start the iterator at the top of the stack!!!
You must throw an "appropriate" Exception (e. g. EmptyStackException) for illegal peek, pop, etc... operations. Regarding size, let's say this remains O(constant) while the Stack size is less than 20 elements, beyond that the push(int) would need to throw a Stack Overflow.

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 22:30, kierafisher05
What is the most popular genre of video games?
Answers: 1
image
Computers and Technology, 23.06.2019 09:00, Riddledjam44623
Before you record your own voice, you should a. record other people's voices b. warm up and practice difficult names c. listen to your favorite songs d. read a transcript of a good radio news segment
Answers: 1
image
Computers and Technology, 23.06.2019 10:00, thezbell
What is estimated time of arrival (eta)? a device that measures the acceleration (the rate of change of velocity) of an item and is used to track truck speeds or taxi cab speeds a gps technology adventure game that posts the longitude and latitude location for an item on the internet for users to find a north/south measurement of position the time of day of an expected arrival at a certain destination and is typically used for navigation applications
Answers: 3
image
Computers and Technology, 23.06.2019 20:00, shaheedbrown06
What software programs are used to to create professional publication? a.) graphics programs b.) word processors c.) page layout programs d.) spreadsheet programs
Answers: 2
You know the right answer?
A. Create ArrayIntStack. java (one that's REALLY O(constant), totally!!!) B. Create the Javadoc web...

Questions in other subjects:

Konu
Mathematics, 09.12.2020 19:50
Konu
Mathematics, 09.12.2020 19:50
Konu
Computers and Technology, 09.12.2020 19:50