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

Merge sorting, ESO207: Programming Assignment 1 Due on 6 Sept, 2015. To be ...

ESO207: Programming Assignment 1 Due on 6 Sept, 2015. To be submitted online. Problem In this assignment you are required to implement k-way Merge Sort algorithm. In this version p

Conversion of general trees into the binary trees, By taking an appropriate...

By taking an appropriate example explain how a general tree can be represented as a Binary Tree.                                                                    C onversio

STACK, WHAT IS THE PURPOSE OF STACK IN C

WHAT IS THE PURPOSE OF STACK IN C

Avl tree rotations, AVL trees and the nodes it contains must meet strict ba...

AVL trees and the nodes it contains must meet strict balance requirements to maintain O(log n) search time. These balance restrictions are kept maintained via various rotation func

B-tree of minimum degree t can maximum pointers in a node, A B-tree of mini...

A B-tree of minimum degree t can maximum pointers in a node T pointers in a node.

Program to implementing stack using linked lists, include include i...

include include include /* Definition of structure node */ typedef struct node { int data; struct node *next; } ; /* Definition of push function */

Relative and direct files, Each data record contains a fixed place in a rel...

Each data record contains a fixed place in a relative file. Each record ought to have associated with it in integer key value which will help identify this slot. Therefore, this ke

What is bubble sort, What is bubble sort? Bubble Sort: The basic ide...

What is bubble sort? Bubble Sort: The basic idea in bubble sort is to scan the array to be sorted sequentially various times. Every pass puts the largest element in its corr

Infix expression into the postfix expression, Q. Convert the given infix ex...

Q. Convert the given infix expression into the postfix expression (also Show the steps) A ∗ (B + D)/ E - F(G + H / k ) Ans. Steps showing Infix to Post fix

Randomized algorithm, need an expert to help me with the assignment

need an expert to help me with the assignment

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