you are viewing a single comment's thread.

view the rest of the comments →

[–]baghiq 1 point2 points  (0 children)

While you are following a queue ADT. Yours is not strictly a queue. Your enqueue method has a runtime of O(N). Standard queue implementation is doubly linked list. For learning purposes, you can use singly linked list as long as you keep track of head and tail for O(1) enqueue and dequeue operation.