Data Structures


  1. What is the difference between Queue and Stack?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    Stack is Last in First out (LIFO) and Queue is First in First out(FIFO).


  1. What are the use of front and rear pointers in CircularQueue implementation?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    CircularQueue implementation is an abstract class where first and rear pointer point to the same object.



  1. What is the correct method used to insert and delete items from the queue?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    enqueue is pushing item into queue; dequeue is removing item from queue; peek returns object without removing it from queue.
    Stack uses push and pop methods. add and remove are used in the list.


  1. Which data structure is used in Breadth First Traversal of a graph?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    In Breadth First Traversal of graph the nodes at the same level are accessed in the order of retrieval (i.e FIFO).



  1. Where does a new element be inserted in linked list implementation of a queue?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    To maintain FIFO, newer elements are inserted to the tail of the list.