A stack is a linear data structure in which insertion and deletion of elements take place from only one end, called the top. It follows the LIFO (Last In First Out) principle: The element inserted ...
前回のキュー編に引き続き、今回はスタック編。 stack_pointerを用意しておく。 配列の上限値(Stack_MAX)を設定しておく。 push()関数では、stack_pointerがStack_MAXに達していない場合において、引数をstackにセットし、stack_pointerをインクリメントする。 push()実行時点 ...