educative.io

Using list as queue for BFS

Hi,
In the BFS solution, list is being used as queue. One downside of using list as queue is popping the first element will actually take O(n), since it will have to rearrange items. But, in the solution, it is considered O(1), instead of O(n)?

Can you explain more what the total time complexity will be, if it is O(n)?