The difference can be seen in underlying implementation and below time complexity.
LinkedList also implements Queue, hence gets the properties of Queues, (FIFO),
main difference is in traversal, in LinkedList you have to traverse link by link, hence get operation is
of O(n).
The time complexity comparison is as follows:
No comments:
Post a Comment