## What require the single argument A?Ans) Dequeue() removes

What is a Stack ADT ?It is linear data structure where there is one element and another element and then another element.  Behaviour of the Stack ADT :It is a list which is flexible with its size.A stack is what would be called a LIFO data structure, last in first out.It’s much like an actual stack of plates. The last plate you put on top of that stack, that’s going to be the first one you remove, its LIFO, last in first out.Operations on Stack include :isempty() – Checks if the stack is empty (Returns True/False)isfull()- Checks if the stack is full (Returns True/False)push()-Pushes the element into the stackpop()- Removes the element from the listWhat is a Queue ADT ?It is linear data structure and works on FIFO( first in first out). Behaviour of the Stack ADT :It has a Restriction of performing insertion at one end and deletion at the opposite end.?It is flexible with its size.Operations on Queue include :enqueue() – Inserts the element,dequeue() – Deletes the element and returns it.isempty() – Checks if the queue is empty (Returns True/False)isfull() – Checks if the queue is full (Returns True/False) Difference between a non-circular queue and a circular queue :A non-circular queue is in the form of a line where elements are queued behind each other, it has endsA circular queue is in the form of a circle. Last and first element are connected , it has no ends.Non-circular queue works on FIFO. Insertion and deletion must be in a sequential order.Circular queue does not have any order of insertion and deletion.It can be done from any position.Vacancy must be created in-order to insert an element in non circular queue.Simultaneous insertion and deletion can be done in circular queue.Diagrams : ?Pseudocode :?Queue: isfull(A)  isfull(A)      if rear(A) = length(A)      then x = 1      else x = rear(A) + 1      if x = front(A)      then return True      else return FalseQueue:isempty(A)  isempty(A)      if front(A) = rear(A)      then return True      else return FalseQueue: enqueue(A, x)Enqueue(A,n)      if isfull(A)      then error “Queue is full”      else Arear(A) = x           if rear(A) = length(A)           then rear(A) = 1           else rear(A) = rear(A) + 1Queue: dequeue(A)  Dequeue(A)      if isempty(A)      then error “Queue is empty”      else x = Afront(A)           if front(A) = length(A)           then front(A) = 1           else front(A) = front(A) + 1      return xWhy does each operation except enqueue(A, x) only require the single argument A?Ans) Dequeue() removes the element from the front which  only requires the list as argument?.isfull() and isempty() returns true or false values which only requires the list as argumentWhile enqueue() should specify the element as well as the the list so it has two arguments.

x Hi!
I'm Barry!

Would you like to get a custom essay? How about receiving a customized one?

Check it out