Un tipo di dato astratto definisce un insieme di valori e le operazioni consentite su di essi, descritti puramente dal comportamento — non dal codice. L'implementazione è la struttura concreta (array, lista collegata, albero) che realizza quel comportamento.
Perché è importante
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.
Perché separare i due
python
:
(): ...
(): ...
(): ...
