Data Structure & Algorithm in Java

  1. Home
  2. Docs
  3. Data Structure & Alg...
  4. Introduction to Data Stru...
  5. Data types, Data Structure and Abstract data type(ADT)

Data types, Data Structure and Abstract data type(ADT)

data types in java
  • .Primitive data types: The primitive data types include Boolean, char, byte, short, int, long, float and double.
  • Non-primitive data types: The non-primitive data types include classes, interfaces and arrays


  1. Linear Data Structures:
    • Arrays: Contiguous memory locations used to store elements of the same data type.
    • Linked Lists: Elements are stored in nodes, where each node contains a data field and a reference to the next node.
    • Stacks: Follows the Last In, First Out (LIFO) principle, where elements are inserted and removed from the same end.
    • Queues: Follows the First In, First Out (FIFO) principle, where elements are inserted at the rear and removed from the front.
  2. Non-linear Data Structures:
    • Trees: Hierarchical data structures consisting of nodes connected by edges, with a single root node and child nodes.
      • Binary Trees: Each node has at most two children, typically called the left child and the right child.
      • Binary Search Trees (BST): A type of binary tree where the left child is less than the parent, and the right child is greater.

3.Static vs. Dynamic Data Structures:

  • Static Data Structures: Size and structure are fixed at compile-time and cannot be modified during program execution.
  • Dynamic Data Structures: Size and structure can be modified dynamically during program execution.
  • ADT is a blueprint for creating a data structure that defines the behavior and interface of the structure, without specifying how it is implemented.
  • An ADT in the data structure can be thought of as a set of operations that can be performed on a set of values. This set of operations actually defines the behavior of the data structure, and they are used to manipulate the data in a way that suits the needs of the program.

How can we help?

Leave a Reply

Your email address will not be published. Required fields are marked *