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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 04:00
Chloe is building a kiosk-based excel application. she wants to make some modifications to the screen elements in order to keep users from being distracted by parts of the application that are irrelevant to her application. she turns to henry for guidance as she knows he built a similar solution earlier this year.chloe has decided to hide the worksheet gridlines and the vertical scroll bar. what does henry tell her to use to do this? a) screen elements dialog boxb) display options dialog boxc) customization dialog boxd) excel options dialog box
Answers: 2
question
Computers and Technology, 22.06.2019 21:00
Ulia is planning to attend the same private four-year college her parents attended. she wants to save at least $18,000 in four years to contribute to her college education. which monthly deposit amounts can julia use to achieve her goal? check all that apply.
Answers: 2
question
Computers and Technology, 23.06.2019 15:10
What role did women fill during world war ii?
Answers: 1
question
Computers and Technology, 23.06.2019 21:20
In microsoft word, when you highlight existing text you want to replace, you're in              a.  advanced mode.    b.  automatic mode.    c.  basic mode.    d.  typeover mode
Answers: 1
You know the right answer?
A. Create ArrayIntStack. java (one that's REALLY O(constant), totally!!!) B. Create the Javadoc web...
Questions
question
Mathematics, 03.05.2021 23:00
question
Mathematics, 03.05.2021 23:00
question
Mathematics, 03.05.2021 23:00
question
Physics, 03.05.2021 23:00
question
Mathematics, 03.05.2021 23:00
question
Mathematics, 03.05.2021 23:00
question
Mathematics, 03.05.2021 23:00
Questions on the website: 13722367