What is Data Structure and it types?

  • Data structure is a fundamental concept of any programming language, essential for algorithmic design.
  • It is used for the efficient organization and modification of data.
  • DS is how data and the relationship amongst different data is represented, that aids in how efficiently various functions or operations or algorithms can be applied.

Types
There are two types of data structures:

  • Linear data structure: If the elements of a data structure result in a sequence or a linear list then it is called a linear data structure. Example: Arrays, Linked List, Stacks, Queues etc.

  • Non-linear data structure: If the elements of data structure results in a way that traversal of nodes is not done in a sequential manner, then it is a non linear data structure. Example: Trees, Graphs etc.

Applications

Data structures form the core foundation of software programming as any efficient algorithm to a given problem is dependent on how effectively a data is structured.

  • Identifiers look ups in compiler implementations are built using hash tables.
  • The B-trees data structures are suitable for the databases implementation.
  • Some of the most important areas where data structures are used are as follows:
    1. Artificial intelligence
    2. Compiler design
    3. Machine learning
    4. Database design and management
    5. Blockchain
    6. Numerical and Statistical analysis
    7. Operating system development
    8. Image & Speech Processing
    9. Cryptography

Data Structures are required to store data in an efficient manner. Certain data processing operations are cheaper in terms of computation time and space if the data is stored in a particular manner.

Broadly, data structures are classified into 2 categories:

  1. Primitive:
    These are some fundamental and basic data structures.
    In java, there are 8 primitives: boolean, byte, char, short, int, long, double, float
  2. Non Primitive:
    They refer objects.
    There are also multiple built-in methods readily available to be used.
    Eg: stack, queue, linkedlist, etc.
    Non-primitive is further divided into 2 categories:
    a. Linear : arranges data in a sequential manner. Eg: arrays, linkedlist, stack, queues
    b. Non Linear : arranges data in a non sequential manner. Eg: trees , graphs