Abstract data type- queue, Data Structure & Algorithms

Assignment Help:

A significant aspect of Abstract Data Types is that they explain the properties of a data structure without specifying the details of its implementation. The properties might be implemented independent of any implementation in any programming language.

Queue is a set of elements, or items, for which the given operations are defined:

createQueue(Q) : It create an empty queue Q;

isEmpty(Q): is a boolean type predicate which returns ''true'' if Q exists and is empty, and returns ''false'' otherwise;

addQueue(Q,item) adds the given item to the queue Q; and deleteQueue (Q, item) : delete an item through the queue Q;

next(Q) eliminate the least recently added item which remains in the queue Q, & returns it as the value of the function;

isEmpty (createQueue(Q)) : It is always true, and deleteQueue(createQueue(Q)) : error

The primitive isEmpty(Q) is needed to know whether the queue is empty or not, Since calling next on an empty queue must cause an error. Like stack, the situation might be such while the queue is "full" in the case of a finite queue. But we ignore defining this here as it would based on the real length of the Queue defined in a particular problem.

The word "queue" is like the queue of customers at counter for any service, wherein customers are dealt along with in the order where they arrives i.e. first in first out (FIFO) order. In most of the cases, in the queue the first customer is the first to be served.

As pointed out previous, Abstract Data Types define the properties of a structure without indicating an implementation in any way. Therefore, an algorithm that works with a "queue" data structure will work wherever this is implemented. Usually different implementations are of different efficiencies.


Related Discussions:- Abstract data type- queue

Define about the structure - container, Define about the Structure - Contai...

Define about the Structure - Container - Some containers hold elements in some sort of structure, and some don't. Containers with no structure include bags and sets. Containe

Stacks, Q. Explain w hat are the stacks? How can we use the stacks  to chec...

Q. Explain w hat are the stacks? How can we use the stacks  to check whether an expression is correctly parentheses or not. For example (()) is well formed but (() or )()( is not w

Representation of a polynomial with a singly linked list, List areutilized ...

List areutilized to maintainPOLYNOMIALS in the memory. For example, we have a functionf(x)= 7x 5 + 9x 4   - 6x³ + 3x². Figure depicts the representation of a Polynomial by means o

Convertion, how we can convert a graph into tree

how we can convert a graph into tree

Explain dijkstra''s algorithm, Explain Dijkstra's algorithm Dijkstra's ...

Explain Dijkstra's algorithm Dijkstra's algorithm: This problem is concerned with finding the least cost path from an originating node in a weighted graph to a destination node

Size of stack, The size of stack was declared as ten. Thus, stack cannot ho...

The size of stack was declared as ten. Thus, stack cannot hold more than ten elements. The major operations which can be performed onto a stack are push and pop. However, in a prog

Question, A binary search tree is used to locate the number 43. Which of th...

A binary search tree is used to locate the number 43. Which of the following probe sequences are possible and which are not? Explain. (a) 61 52 14 17 40 43 (b) 2 3 50 40 60 43 (c)

Methods of collision resolution, Methods of Collision Resolution 1)  Co...

Methods of Collision Resolution 1)  Collision Resolution by separate chaining  2)  Collision Resolution by open addressing

Mcs-021, #questWrite an algorithm for multiplication of two sparse matrices...

#questWrite an algorithm for multiplication of two sparse matrices using Linked Lists.ion..

Decision tree, . Create a decision table that describes the movement of inv...

. Create a decision table that describes the movement of inventory

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd