how we can say that each node is pushed once and popped once so its complexity becomes o(n). plz explain???
Complexity issue
hey since the number of nodes is n and we will iterate each node only once the complexity will be O(n). we only iterate over the nodes in the queue.