GeeksforGeeks » C/C++ Programming Questions

Variable number of integers

(2 posts)
  1. raj
    Member
    Posted 1 year ago #

    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

  2. kartik
    Moderator
    Posted 1 year ago #

    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.

RSS feed for this topic