ایک abstract data type اقدار کا ایک مجموعہ متعین کرتا ہے اور ان پر operations کی اجازت دیتا ہے، جو صرف behavior کے ذریعے بیان کیے جاتے ہیں — کوڈ کے ذریعے نہیں۔ Implementation وہ concrete structure (array، linked list، tree) ہے جو اس behavior کو حقیقت میں لاتی ہے۔
ایک جیسا ADT، مختلف implementations
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
:
(): ...
(): ...
(): ...
