Answer to Question #247614 in Software Engineering for samii

Question #247614

a) The stack class has been created as follows:

class Stack { 

int maxSize; 

double stackÄrray[ ] 

int top;

i) Write the constructer method to initiate Stack class properties.  

ii) Write the pop() method to remove a value from the Stack.

public double pop ( )

b) Assume S is stack developed using a linked list. 

Show the final contents of the Stack after executing the following code.

for (int k=1; k<=7;k++)

   s. push (k) ; 

for (int k=1; k<=7;k++)   

s . push (s.pop ( ) ) ;

c) The Queue class has been created as follows, to store integer values.

class Queue {

LinkedList queueList; 

int n Items;


i)Write the constructor to initiate the Queue class properties.

ii)Write a method to insert a value to the Queue.

public void insert (int i)

iii)Write a method to delete a value from a Queue.

public Link delete()

iv)What is the major limitation of Linear queues?



1
Expert's answer
2021-10-08T11:52:33-0400
Dear samii, your question requires a lot of work, which neither of our experts is ready to perform for free. We advise you to convert it to a fully qualified order and we will try to help you. Please click the link below to proceed: Submit order

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS