Abstrakcyjny typ danych definiuje zbiór wartości i operacje dozwolone na nich, opisane wyłącznie przez zachowanie — nie przez kod. Implementacja to konkretna struktura (tablica, lista wiązana, drzewo), która realizuje to zachowanie.
Ten sam ADT, różne implementacje
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.
Dlaczego to rozdzielić
python
:
(): ...
(): ...
(): ...
