Ask a Question

Is Circular Queue a non-linear Data Structure? Justify your answer.

on 2011-02-15 19:41:23   by sanjit   on MCA  1 answers

sourav

on 2011-02-21 10:30:00  

no,absolutely not. because it is not that only the name posses the word \"circular\",that is why it will become a non-linear data structure.Again from the defn of queue we come to know that Queue is a linear data structure(whether it is a simple queue,circular queue,or a deque).In circular queue the data are arranged in a linear way,but when the queue is in overflow state,it goes back to the starting position of the queue(simply by using the idea of modular division). e.g if m=n mod 6,for any integer n,we get some paricular values of m,i.e m=1,2,3,4,5. Let the size of the queue be 6units,and the insertion being done in the memory space according to the above mod function.Therefore when n=5,m=5,i.e the endpoint of the queue is reached.Now on next insertion the new value of n=6,and m=0,i.e the next insertion will be tried at 0th position of the queue.