今回の記事ではいつもAtcoder中にpythonの普通のリストだと計算量的に間に合わないけどなんかデータ型使えば上手く行けたはず,,,ってのを記事にしてまとめておきます. リスト型の計算量について ・heapq.heapify(リスト)でリストを優先度付きキューに変換 ...
今日は、データの「並び方」のルールである 「スタック(Stack)」 と 「キュー(Queue)」 について一緒に考えてみよう。 これを知ると、プログラムの中で「どの順番で処理をこなしていくか」を、もっと賢く整理できるようになるんだよ。 1. 最後に置いた ...
This project was on circular double ended queues (deque) using both a circular array and a circular doubly linked list (CDLL) as underlying structures. This project was for my data structures and ...
Classic Snake Game built with pygame library and collections.deque(Arrays are terrible for the memory). The snake can eat food, grow longer, and collide with itself. Who likes boundaries, so snake is ...