Is there a standard "stack" data structure in Python?

4

If not, do you know a good non-standard module? I would need to work with stack , but I find it very strange that there is no standard stack (stack) module in Python and at the same time there is a queue (queue) module.

    
asked by anonymous 25.11.2014 / 21:12

1 answer

5

No. The default language recommendation is using a list as a stack .

In the case of a queue ( queue ), additional methods and constraints are required for the queue to be handled correctly. There are several types of queues , namely:

  • % FIFO, First In, First Out )
  • % w / w ( Last In, First Out )
  • Queue (in ascending order of value)
25.11.2014 / 21:16