What is data structure ? Point out at least two data structure that you have used. Support your answers with example.

A Data Structure is a way of organizing, storing, and managing data in a computer so that it can be accessed and modified efficiently.

It helps in:

  • Storing data systematically
  • Performing operations like insertion, deletion, searching, and sorting
  • Improving program performance

A data structure decides how data is arranged in memory.

 

 

 

Two Data Structures I Have Used (With Examples)

1. Array

An Array is a linear data structure that stores elements of the same type in continuous memory locations.

 

Here:

  • marks[0] = 85
  • marks[3] = 92

Where it is used:

  • Storing student marks
  • Storing list of numbers
  • Performing sorting and searching

Advantage: Fast access using index number.
Limitation: Fixed size.

 

2. Linked List

A Linked List is a linear data structure where elements (nodes) are connected using pointers. Each node contains:

  • Data
  • Address of next node

Example:

Suppose we store numbers:
10 → 20 → 30

Each element points to the next element.

Where it is used:

  • Implementing stacks and queues
  • Memory management
  • Dynamic data storage

Advantage: Dynamic size (can grow or shrink).
Limitation: No direct index access.

Leave Comment