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
The following DNA sequences are extracted from promoter region of genes which are co-regulated by the same transcription factor (TF). The nucleotide segments capitalized in the giv

It offers an effective way to organize data while there is a requirement to access individual records directly. To access a record directly (or random access) a relationship is

Illustrate the intervals in mathematics Carrier set of a Range of T is the set of all sets of values v ∈ T such that for some start value s ∈ T and end value e ∈ T, either s ≤

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

Write the non-recursive algorithm to traverse a tree in preorder.    The Non- Recursive algorithm for preorder traversal is as follows: Initially  push NULL onto stack and

Define Strictly Binary Tree Strictly Binary Tree: - If each non leaf node in binary tree has non empty left and right sub-trees , then the tree is known as a strictly binary t

In a sorted list, Binary search is carried out by dividing the list into two parts depends on the comparison of the key. Since the search interval halves each time, the iteration o

Q. State the difference between a grounded header link list and a circular header link list?     Ans: A header linked list is a linked list which all the time c

Example 1:  Following are Simple sequence of statements Statement 1;  Statement 2; ... ... Statement k; The entire time can be found out through adding the times for

Write an algorithm for multiplication of two sparse matrices using Linked Lists.