Data Structures
- What is the difference between Queue and Stack?
-
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).
- What are the use of front and rear pointers in CircularQueue implementation?
-
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.
- What is the correct method used to insert and delete items from the queue?
-
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.
- Which data structure is used in Breadth First Traversal of a graph?
-
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).
- Where does a new element be inserted in linked list implementation of a queue?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
To maintain FIFO, newer elements are inserted to the tail of the list.