Introduction to DSA

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.
Linear Data structures
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
Static Data Structures - In Static Data Structures, fixed size memory is allocated. Memory is allocated at compile time.
Example: Arrays
Dynamic Data Structures - In Dynamic Data Structures, memory size is not fixed. Here, memory is allocated at runtime.
Examples: Queues, Stack etc.
Subscribe to my newsletter
Read articles from Divya Chinthala directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
