Abstraktní datový typ definuje sadu hodnot a operace na nich povolené, popsané čistě chováním – nikoli kódem. Implementace je konkrétní struktura (array, linked list, tree), která toto chování realizuje.
Stejný ADT, různé implementace
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.
Proč je oddělit
python
:
(): ...
(): ...
(): ...
