An array is a collection of items stored at contiguous memory locations. The array is used to store multiple data …

Write a program to input elements in an array and find reverse of an array. So in this post, we …

Given a linked list, write a program to find middle element of a linked list. e.g.- for linked list …

Given a linked list, write a program to reverse elements of a linked list. e.g.- for linked list 1 …

Balanced brackets problem is one of the famous problems based on the stack and it has been asked in many …

Height of a tree is the total number of nodes on the path from the root node to the deepest …

Write a program to find the nearest greater element or next greater to the right of each element in an …

In this tutorial, we will implement a stack using array by using the fixed array and dynamic array method with …

In this tutorial, we will implement a stack using linked list with their time and space complexity.

Write a program to find the nearest greater element or next greater to the left of each element in an …

Stock span problem is a financial problem mostly asked in interviews and its optimized solution can be obtained using stack …

Write a program to find the nearest smaller element or next smaller element to the right of each element in …

Write a program to find the nearest smaller element to the left of each element in an array.

Write a program to find the maximum area under histogram or largest rectangle in a histogram. It's optimized solution …

In this introduction part of the linked list, we will learn about the basics of a Linked List, like its …

A Linked List or Singly Linked List is a linear data structure which collectively represents a sequence of data. In …

A Doubly Linked List is a linear data structure which collectively represents a sequence of data in which each node …

In this problem, we have to find a pair of number in an unsorted array which adds up to the …

A tree is a non-linear data structures in which each node can point to a number of nodes. A tree …

A binary tree is a non-linear and hierarchical data structure which has zero children, one child or two children. An …

Binary tree traversals can be done by Depth-first traversal and Breadth-first traversals or Level order traversal. Preorder traversal, Inorder traversal …

Program to print reverse level order traversal of a binary tree i.e., print data in a binary tree from …

Given an array write a program to find the second largest element in an array by using the efficient possible …

Find the maximum element in a Binary tree using recursion or iterative solution. For example, a binary tree contains the …

Given an array write a program to rotate the array of size "n" to left/anticlockwise direction by "k" elements …

Search a node in a Binary tree using recursion or iterative solution. For example, a binary tree contains the following …

Find the size of a Binary tree using recursion or iterative solution. For example, a binary tree contains the following …

The rightmost node among the leaf nodes is known as the deepest node in a binary tree. Find the deepest …

Those nodes in the tree which don't have any child are known as leaf nodes i.e., A node …

Those nodes in the tree which have both the children are known as full nodes i.e., A node is …

Those nodes in the tree which have only one child are known as half nodes i.e., A node is …

Write a program to compare the structure of two binary trees without data and if they are identical then return …

Write a program to compare the structure data of two binary trees and if they are identical then return true …

Write a program to find the maximum level sum in a binary tree even if nodes may have negative values …

The diameter of a tree is the number of nodes on the longest path between two leaves in the tree …

Write a program to find all root to leaf paths of a Binary tree. A tree has different paths from …

A Binary Search Tree is a non-linear data structure in which all the left subtree keys should be less than …

In this tutorial, we are going to learn that how to search a node in a Binary search tree using …