Skip to content

Data Structures

This content is for DSA. Switch to the latest version for up-to-date documentation.

Data Structures are a way of collecting and organising data in such a way that we can perform operations on these data in an effective way.

Diagram
  • Primitive: Integer, Character, Boolean, Float, etc.
  • Non-Primitive:
    • Linear:
      • Arrays
      • Lists
      • Linked Lists
      • Stacks
      • Queues
    • Non-Linear: ❌
      • Trees
      • HashMaps
      • Graphs

These are basic built-in data types in Java.

TypeDescriptionExample
int32-bit integer, range: -2,147,483,648 to 2,147,483,647int i = 123456;
charSingle 16-bit Unicode characterchar c = 'A';
booleanTrue or false valueboolean flag = true;
float32-bit floating-point, single precisionfloat f = 3.14f;
double64-bit floating-point, double precisiondouble d = 3.14159;
byte8-bit integer, range: -128 to 127byte b = 100;
short16-bit integer, range: -32,768 to 32,767short s = 20000;
long64-bit integer, range: very large whole numberslong l = 123456789L;

Are more complex and are made up of primitive data types. They can be divided into two types:

  • Linear Data Structures
  • Non-linear Data Structures

Data elements are arranged in a sequential manner, where each element is connected to its previous and next element.

Data elements are not arranged sequentially - they can have multiple connections.

Built with passion by Ngineer Lab