HttpOnly cookie in Django

For authentication in a Single page application, it is a common approach to use token-based authentication where a token is …

Size of a binary tree

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

Search a node in Binary tree

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

Left rotation of an array

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

Maximum in Binary tree

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

Second largest element in an array

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

Reverse level order traversal

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

Binary tree traversals

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

Introduction to Binary Tree

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

Introduction to Trees

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

Pair with given sum in an array

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

Data fetching in Next.js

Next.js provides various ways to fetch data from an API or any other source. These methods can be used …

Doubly Linked List

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

Linked List

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

Introduction to Linked list

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

Maximum area histogram

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

Nearest smaller to left

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

Nearest smaller to right

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

Stock span problem

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

Nearest greater to left

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