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 08:30
Today is the anniversary of me being on yet, i don't need it anymore! here's a picture of my dog wearing a bowtie! my question is, how do i delete my account?
Answers: 1
question
Computers and Technology, 22.06.2019 10:30
You have a large, late-model pick-up truck with a rear seat. the pick-up truck weighs 6,500 pounds. the florida seat belt law
Answers: 1
question
Computers and Technology, 23.06.2019 00:30
Which of the following would you find on a network
Answers: 3
question
Computers and Technology, 23.06.2019 06:30
Martha is designing a single-player game. her manager suggests that she plan the design to incorporate future modifications. which principle of game design relates to planning for future modifications?
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
Health, 25.10.2020 14:00
question
Mathematics, 25.10.2020 14:00
question
English, 25.10.2020 14:00
question
Mathematics, 25.10.2020 14:00
question
Mathematics, 25.10.2020 14:00
Questions on the website: 13722359