Introduction to DSA

Divya ChinthalaDivya Chinthala
1 min read

Definition:

A data structure is a way of storing, managing and organizing data in a computer to enable efficient access, insertion, deletion and modification. Choosing the right data structure helps in writing optimized and faster programs.

Data structures are classified into two categories based on how data is organized.

  1. Linear Data structures

  2. Non-Linear Data structures

Linear Data Structures: Data elements stored sequentially in a specific order. Each element is connected. We can access the previous and next elements based on the current element.

Examples: Arrays, Queues, Stack, Linked Lists

Non-Linear Data Structures: Data elements are not stored sequentially and may follow a hierarchical or complex relationships. There is no strict ordering, so we cannot access next and previous elements directly.

Examples: Trees, Graphs, Hash Tables

Linear Data Structures are again divided in two categories based on memory allocation

  1. Static Data Structures - In Static Data Structures, fixed size memory is allocated. Memory is allocated at compile time.

    Example: Arrays

  2. Dynamic Data Structures - In Dynamic Data Structures, memory size is not fixed. Here, memory is allocated at runtime.

    Examples: Queues, Stack etc.

5
Subscribe to my newsletter

Read articles from Divya Chinthala directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Divya Chinthala
Divya Chinthala