GeeksforGeeks » C/C++ Programming Questions
Variable number of integers
(2 posts)-
What do you mean by a stack or a queue in which each item is a variable number number of integers?
Is it a queue of a queue, queue of a stack etc -
I am not very clear about the question, below is some idea I have :)
It can be queue of queues or queue of stacks. Basically every entry of the queue is a pointer to a linked list (LL). If you enter an item at the front of the LL and remove from the front then it is a queue of stacks. If you enter an item at the rear and remove from the front then queue of queue.
Every entry can also be a pointer to root of a tree, so it can be a queue of trees also :)
BTW, what is the source of the question?
Reply
You must log in to post.