抽象データ型は、一連の値と、それらに対して許可された操作の集合を定義し、動作によってのみ記述されます — コードではなく。実装は、その動作を実現する具体的な構造(配列、連結リスト、木)です。
同じADT、異なる実装
text
ADT "Queue": enqueue, dequeue, peek (FIFO contract)
Implementation A: array + two indices (ring buffer)
Implementation B: doubly linked list with head/tail pointers
Both honor the SAME contract; cost profiles differ.
なぜ分離するのか
python
:
(): ...
(): ...
(): ...
