ADT(Abstract Data Type) Vs Data Structure Interview question

(Last Updated On: August 3, 2016)

Answer: ADT (Abstract Data type) represents a set of particular behaviors. for example, LIST represents a sequence of values, a QUEUE represents a FIFO(First in First Out) logic on additions/deletions operations etc.

ADTs are abstracted from the implementation detail of operations. For example, Add() & Remove() operations of LIST abstract data type does not have its own implementation but uses the concrete implementation of Data Structures i.e. ArrayList and LinkedList etc.

A data structure is a specialized format for organizing and storing data. All Data structures have their concrete implementation for its all operations e.g. Add() & Remove() etc.

Actually, All ADTs are implemented by using some data structures. for example. LIST can be implemented using ArrayList and LinkedList data structures. MAP can be implemented using HashMap, LinkedHashMap and TreeMap data structures etc.

Listing ADTs and Data Structure used.

ADT: LIST
Data Structures Used: ArrayList and LinkedList etc.

 

ADT: MAP
Data Structures Used: HashMap, LinkedHashMap and TreeMap etc.

 

ADT: QUEUE
Data Structures Used: ArrayList and LinkedList etc.

 

ADT: Priority Queue
Data Structures Used:  Binary Heap, ArrayList and LinkedList etc. – In Java Priority Queue has been implemented using Binary Heap Data Structure.

 

In fact, In Java all ADTs are available as an Interface and multiple Data Structures implement them.