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
write an algorithm to sort given numbers in ascending order using bubble sort

What are the Dynamic arrays Dynamic arrays are convenient for programmers since they can never be too small-whenever more space is needed in a dynamic array, it can simply be e

Define the terms     i) Key attribute     ii) Value set  Key attribute:  An entity  type  usually  has  an attribute  whose  values  are  distinct  fr

Efficiency of Linear Search How much number of comparisons is there in this search in searching for a particular element? The number of comparisons based upon where the reco

Q. Give the algorithm for the selection sort. Describe the behaviours of selection sort when the input given is already sorted.

Explain the Memory Function method The Memory Function method seeks to combine strengths of the top  down and bottom-up approaches  to  solving  problems  with  overlapping  su

Q. Describe the basic concept of binary search technique? Is it more efficient than the sequential search?         Ans : The bin ary search technique:- This tec

Q. Reverse the order of the elements on a stack S    (i) by using two additional stacks (ii) by using one additional queue. Ans :      L e t S be the stac

So far, we now have been concerned only with the representation of single stack. What happens while a data representation is required for several stacks? Let us consider an array X

A Sort which relatively passes by a list to exchange the first element with any element less than it and then repeats with a new first element is called as      Quick sort.