3 ms·
The Python code is mostly clear and beautiful. Just one small wish: please use collections.deque() instead of showing an O(n) insertion into a list using "de
by raymondh 11y ago
The Python code is mostly clear and beautiful. Just one small wish: please use collections.deque() instead of showing an O(n) insertion into a list using "deck[0:0] = [card]".
- norvig 11y agoYou're right! 2.4 was out when I wrote that, so I could/should have used dequeue. But I wanted to use things that I thought readers would be familiar with, and timing wasn't a big issue.