I am doing an assignment for class and it requires me to Develop an algorithm using the Java programming language that implements a "> I am doing an assignment for class and it requires me to Develop an algo">

Question Details

[solution] »

I am doing an assignment for class and it requires me to Develop an algo


Brief item decscription

Answer Download


Item details:

I am doing an assignment for class and it requires me to Develop an algorithm using the Java programming language that implements a basic stack data structure.

Here is the scenario: Assume that you are developing a system for a manufacturing assembly line that builds automobiles. There are three stations in the manufacturing line where an inspector will visually inspect the vehicle. You program must keep track of these inspections as they occur. You decided to develop your program using a stack data structure. As your vehicle begins the line you will push the number 0, which indicates that that an inspection has not yet occurred, onto the stack three subsequent times. At each station in the line you will pop one of the items off of the stack. Each time your algorithm pops an item from the stack you must print it out to the console using the system.out.println function. I will post my code below. Does my code represent this scenario and how do i perform the Asymptotic analysis of my algorithm?

My Code:

import jeliot.io.*; public class MyStack { private int maxSize; private long[] stackArray; private int top; public MyStack(int s) { maxSize = s; stackArray = new long[maxSize]; top = -1; } public void push(long j) { stackArray[++top] = j; } public long pop() { return stackArray[top--]; } public long peek() { return stackArray[top]; } public boolean isEmpty() { return (top == -1); } public boolean isFull() { return (top == maxSize - 1); } public static void main(String[] args) { MyStack theStack = new MyStack(5); theStack.push(0); theStack.push(1); theStack.push(2); theStack.push(3); theStack.push(4); while (!theStack.isEmpty()) { long value = theStack.pop(); System.out.print(value); System.out.print(" "); } System.out.println(""); } }

 


Notice: Undefined index: payment_status in /home/aceyourh/studycourse.fun/wp-content/themes/premier/page-templates/paper-detail.php on line 248






About this question:
STATUS
Answered
QUALITY
Approved
ANSWER RATING

This question was answered on: Oct 14, 2020

PRICE: $20

Solution~000121875.zip (18.37 KB)

Buy this answer for only: $20

This attachment is locked

We have a ready expert answer for this paper which you can use for in-depth understanding, research editing or paraphrasing. You can buy it or order for a fresh, original and plagiarism-free copy (Deadline assured. Flexible pricing. TurnItIn Report provided)

Pay using PayPal (No PayPal account Required) or your credit card. All your purchases are securely protected by PayPal.
SiteLock

Notice: Undefined variable: ip_country in /home/aceyourh/studycourse.fun/wp-content/themes/premier/page-templates/paper-detail.php on line 456

Need a similar solution fast, written anew from scratch? Place your own custom order

We have top-notch tutors who can help you with your essay at a reasonable cost and then you can simply use that essay as a template to build your own arguments. This we believe is a better way of understanding a problem and makes use of the efficiency of time of the student. New solution orders are original solutions and precise to your writing instruction requirements. Place a New Order using the button below.

Order Now