એક અમૂર્ત ડેટા પ્રકાર મૂલ્યોના સમૂહ અને તેમ પર પરવાનગી આપવામાં આવેલા કામગીરી વ્યાખ્યાયિત કરે છે, શુદ્ધરૂપે વર્તન દ્વારા વર્ણવાય છે — કોડ દ્વારા નહીં। અમલીકરણ ઠોસ માળખો (array, linked list, tree) છે જે તે વર્તનને સાકાર કરે છે।
એક જ 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
:
(): ...
(): ...
(): ...
