Every data structure has its own advantages and disadvantages while performing the following operations:

  1. Insert a new data item
  2. Delete a specified item
  3. Search for a specified item

The summary of Advantages and Disadvantages of Data Structure

Data StructureAdvantagesDisadvantages
StackProvides Last-In-First-Out (LIFO) accessSlow access to other items than on last position
QueueProvides First-In-First-Out (FIFO) accessSlow access to other items than on first position
ArrayFast Insertion, Fast search if index is knownFixed Size, Slow Insertion, Slow Deletion
Ordered ArrayQuicker search than unsorted arrayFixed Size, Slow Insertion, Slow Deletion
Linked ListQuick Deletion, Quick InsertionSlow search
Hash TableFast Insertion, Very fast access for known keySlow access if key is now known, Slow deletion, Inefficient memory usage
Binary TreeQuick search, insertion, deletion (if tree remains balanced)Deletion algorithm is complex
Red-black treeQuick search, insertion, deletion, Tree always balancedComplex
2-3-4 TreeQuick search, insertion, deletion, Tree always balanced, Similar tress good for disk storageComplex
HeapFast Insertion, Deletion, access to largest itemSlow access to other items