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

Linked list implementation of any circular queue, Link list representation ...

Link list representation of a circular queue is more efficient as it employs space more competently, of course with the added cost of storing the pointers. Program 7 gives the link

Comparisions and assignments in worst case, Q. Calculate that how many key ...

Q. Calculate that how many key comparisons and assignments an insertion sort makes in its worst case?        Ans: The worst case performance occurs in insertion

Complete trees, This is a k-ary position tree wherein all levels are filled...

This is a k-ary position tree wherein all levels are filled from left to right. There are a number of specialized trees. They are binary trees, AVL-trees, binary search trees, 2

Abstract data type- queue, A significant aspect of Abstract Data Types is t...

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 im

Single pointer pointing to the tail of the queue, Can a Queue be shown by c...

Can a Queue be shown by circular linked list with only single pointer pointing to the tail of the queue? Yes a Queue can be shown by a circular linked list with only single p

Insertion of element into a linked list, ALGORITHM (Insertion of element in...

ALGORITHM (Insertion of element into a linked list) Step 1 Begin the program Step 2 if the list is empty or any new element comes before the start (head) element, then add t

If else, design algorithm and flow chart that computes the absolute differe...

design algorithm and flow chart that computes the absolute difference of two values x and y

State a algorithm that inputs the heights of all 500 student, As part of an...

As part of an experiment, a school measured heights (in metres) of all its 500 students. Write an algorithm, using a flowchart that inputs the heights of all 500 students and ou

Advantage of list over arrays, The advantage of list over Arrays is flexibi...

The advantage of list over Arrays is flexibility. Over flood is not a problem until the computer memory is bushed. When the individual record are quite large, it may be difficult t

Red-black tree after insertion, The above 3 cases are also considered conve...

The above 3 cases are also considered conversely while the parent of Z is to the right of its own parent. All the different kind of cases can be illustrated through an instance. Le

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