Queue be represented by circular linked list, Data Structure & Algorithms

Q. Can a Queue be represented by circular linked list with only one pointer pointing to the tail of the queue? Substantiate your answer using an example.

Ans.

Yes a Queue can be represented by a circular linked list with only one pointer

pointing to the tail of the queue. for example:

Queue(Q)

 

10                           11                         12                 13

 

Q has a pointer pointing to the tail of 'Q'.

This pointer represents real of the Q and ptr->next is the front of Q.

 

 

Posted Date: 7/13/2012 1:16:23 AM | Location : United States







Related Discussions:- Queue be represented by circular linked list, Assignment Help, Ask Question on Queue be represented by circular linked list, Get Answer, Expert's Help, Queue be represented by circular linked list Discussions

Write discussion on Queue be represented by circular linked list
Your posts are moderated
Related Questions
how to define the size of array

If a Dequeue is implemented via arrays, then this will suffer with the similar problems which a linear queue had suffered. Program 8 gives the array implementation of Dequeue.

Define the Carrier set of the Symbol ADT Carrier set of the Symbol ADT is the set of all finite sequences of characters over Unicode characters set (Unicode is a standard char

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

Definition of Algorithm Algorithm must have the following five characteristic features: 1.      Input 2.      Output 3.      Definiteness 4.      Effectiveness 5


Binary tree creation struct NODE { struct NODE *left; int value; struct NODE *right; }; create_tree( struct NODE *curr, struct NODE *new ) { if(new->val

There are three kinds of tree traversals, namely, Postorder , Preorder and Inorder. Preorder traversal: Each of nodes is visited before its children are visited; first the roo

an electrical student designed a circuit in which the impedence in one part of a series circuit is 2+j8 ohms and the impedent is another part of the circuit is 4-j60 ohm mm program

The first assignment in this course required you to acquire data to enable you to implement the PHYSAT algorithm (Alvain et al. 2005, Alvain et al. 2008) in this second assignment