Data Structures

A data structure is a way of organizing data in the computer's memory so that it can be used effectively and efficiently.

There are mainly two types of data structures-

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

Linear Data structures

Non-linear Data structures


  1. Introduction to Arrays
  2. Reverse elements of an array
  3. Second largest element in an array
  4. Left rotation of an array
  5. Pair with given sum in an array

Linked List

  1. Introduction to Linked list
  2. Linked List
  3. Doubly Linked List
  4. Program to find middle element of a Linked List
  5. Program to reverse a linked list


  1. Stack using array
  2. Stack using linked list
  3. Nearest greater to right
  4. Nearest greater to left
  5. Nearest smaller to right
  6. Nearest smaller to left
  7. Stock span problem
  8. Maximum area histogram
  9. Balanced brackets problem



  1. Introduction to Trees
  2. Binary tree

    1. Introduction to Binary Tree
    2. Binary tree traversals
    3. Reverse level order traversal
    4. Maximum in Binary tree
    5. Search a node in Binary tree
    6. Size of a binary tree
    7. Height of a binary tree
    8. Deepest node in a binary tree
    9. Number of leaf nodes in a binary tree
    10. Number of full nodes in a binary tree
    11. Number of half nodes in a binary tree
    12. Compare structure of two binary trees
    13. Compare structure and data of two binary trees
    14. Maximum level sum in a binary tree
    15. Diameter of a Binary tree
    16. All root-to-leaf paths of a Binary tree

    Binary Search Tree

    1. Introduction to Binary Search Tree
    2. Search a node in Binary search tree
    3. Search the node with minimum value in a Binary search tree