Skip to content

Latest commit

 

History

History
46 lines (36 loc) · 1.47 KB

Introduction to Data Structures.md

File metadata and controls

46 lines (36 loc) · 1.47 KB

What are Data Structures in Java?

Data Structure in Java is defined as the collection of data pieces that offer an effective means of storing and organizing data in a computer. Linked List, Stack, Queue, and arrays are a few examples of Java data structures.

There are two types of Data Structures:-

  1. Primitive Data Structures
  2. Non-primitive Data Structures

Primitive Data Structures

Primitive data Structures are also called Primitive Data Types. byte, short, int, float, char, boolean, long, and double are primitive Data types.

Non-primitive Data Structures

Non-primitive Data Structures are of two types:-

  1. Linear Data Structures
  2. Non-linear Data Structures

Linear Data Structures

The elements arranged in a linear fashion are called Linear Data Structures. Here, each element is connected to one other element only. Linear Data Structures are as follows:

  • Arrays
    • Single dimensional Array
    • Multidimensional Array
  • Stack
  • Queue
  • Linked List
    • Singly-linked list
    • Doubly Linked list
    • Circular Linked List

Non-Linear Data Structures

The elements arranged in a non-linear fashion are called Non-Linear Data Structures. Here, each element is connected to n-other elements. Non-Linear Data Structures are as follows:

  • Trees
    • Binary Tree
    • Binary Search Tree
    • AVL Tree
    • Red-Black Tree
  • Graph
  • Heap
    • MaxHeap
    • MinHeap
  • Hash
    • HashSet
    • HashMap