Compare structure of two binary trees

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

Walrus operator in Python

Walrus operator (:=) is used as an assignment operator. It assigns value to a variable and also returns the value. …

Number of half nodes in a binary tree

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

Number of full nodes in a binary tree

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

Number of leaf nodes in a binary tree

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

Deepest node in a binary tree

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

JWT token as HttpOnly cookie in Django

It is always recommended to store tokens for authentication as HttpOnly cookie instead of storing them in localStorage as a …

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 and …

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 bottom …

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 to …

Doubly Linked List

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