Python3 Queue is much much slower than list

Правка en1, от YouKnowNothing_JonSnow, 2020-06-09 12:44:03

I was recently trying to solve the Solve the maze using Python3, and for BFS, I was trying to use Python Queue from queue and it was giving TLE, and when I replaced the Queue with list it got Accepted within 300 ms.

Here is the submission with list

Here is the submission with Queue

Any explanation is appreciated.

Thanks, and please be kind, coz me being Jon Snow and everybody keeps saying that to me

Теги #python 3, #queue, list

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский YouKnowNothing_JonSnow 2020-06-09 12:44:03 729 Initial revision (published)