Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Data Structure and Algorithm

Question 1:

Stacks and queues are two ways to store data in a linear fashion.

a. Describe the major difference between a stack and a queue.

b. The picture below is of a coffee cup dispenser. Is it a stack or a queue? Explain. (Hint : LIFO or FIFO)

Question 2:

Using the stack algorithm for computing Post fix expressions, trace the algorithm on the Post fix expression below, showing the stack at the end of each iteration of the loop. (As given on Slide#29 & #30)

(Draw a separate picture of the stack each time, so we can see the overall process of the algorithm.)

Question 3:

You have already created Java project name Algorithm within same project create package name npu.dataStructure.stack and write a class name TheStack with following methods implimantation.

//constructor
public TheStack(int stackSize){ //your code here}

public void push(Object obj){ //your code here } public Object pop(){//your code here }
public Object peek(){//your code here } public boolean isEmpty(){//your code here } private boolean isFull(){//your code here }

public void displayStack(){//your code here }

create another class which will have main method to test TheStack class. Push some Strings in the stackand display the stack. pop all strings out of the stack. Display stack - it should give you message that stack is currently empty. Pop one more extra string from stack - it should give you message indicating that you are trying to pop String out of stack when its empty.

Question 4:

You have already created Java project name Algorithm within same project create package name npu.dataStructure.queue and write a class name TheQueue with following methods implementation.

//constructor
public TheQueue(int capacity){//your code here}

public void insert(Object value){ //your code here}} public void remove(){//your code here}
public void peek(){//your code here}
public int size(){//your code here} //displays current elements in the queue

public boolean isEmpty(){//your code here} public boolean isFull(){//your code here }
public static void displayTheQueue(){ //your code here}

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91899729
  • Price:- $40

Priced at Now at $40, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Question suppose that x 00271 and y 608 are correctly

Question : Suppose that x* = 0.0271 and y* = 6.08 are correctly rounded versions of x and y to 3 digit mantissas. The smallest interval [a,b] that would contain x is [0.02705, 0.02715] since 0.0271 is between those numbe ...

A chemistry student needsnbsp600 mlnbspof carbon

A chemistry student needs 60.0 mL of carbon tetrachloride for an experiment. By consulting the  CRC Handbook of Chemistry and Physics , the student discovers that the density of carbon tetrachloride is 1.59 g.cm^-3. Calc ...

Design a combinational circuit with three inputs a b and c

Design a combinational circuit with three inputs: A, B, and C, D and the output W. The output should be 1 only when the values of A, B interpreted as an unsigned integer (AB) is equal to the values of C, D interpreted as ...

Why is formative evaluation importantprovide at least three

Why is formative evaluation important? Provide at least three reasons for using it. What is the difference between formative and summative evaluation? Provide any two types formative evaluation and two types of summative ...

Question define and briefly discuss the following

Question: Define and briefly discuss the following brainstorming techniques, the delphi technique, brainstorming, or nominal group technique. 1. you are required to write an initial post (300 words). 2. Also discuss adva ...

Letang industrial systems company lisc is trying to decide

Letang Industrial Systems Company (LISC) is trying to decide between two different conveyor belt systems. System A costs $300,000, has a four-year life, and requires $101,000 in pretax annual operating costs. System B co ...

How social capital enhance well-being in high density

How Social Capital enhance well-being in high density community?

It is just a simple calculator code c language ltstdiohgt

It is just a simple calculator code. C++ language library A) Display on the screen the following menu: Welcome to my calculator Please look at the menu below for your calculations 1. Addition 2. Subtraction 3. Multiplica ...

According to the same national collegiate athletic

According to the same National Collegiate Athletic Association data, the means and standard deviations of eligibility and retention rates (based on a 1,000-point scale) for the 2013-2014 academic year are presented, alon ...

Mark harris just received a cash gift from his grandfather

Mark Harris just received a cash gift from his grandfather. He plans to invest in a five-year bond issued by Cullumber Corp. that pays an annual coupon rate of 4.5 percent. If the current market rate is 7.50 percent, wha ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As