Difference between queue and linked list
Answers
Answered by
8
linked list is just a list of data and the link of the next data element where as queue has property that is first in first out which is not there in linked list
Answered by
2
Answer:
Queue is a "linear data structure" that works on the principle of "first in first out" (FIFO). The data in a queue is inserted from the "rear end" and removed from the "front end". In queue least recently added item is removed first.
Linked list is also a form of "linear data structure", where in the data is stored along with the memory address to the next data item.
The main difference between linked list and queue is that in linked list, data can be added or deleted randomly without maintaining any sequence. Essentially, a data item can be appended to first element or last or any of the other middle elements in a linked list, whereas queue follows first come first serve principle.
Similar questions