Tutorialspoint.dev
Welcome To Tutorialspoint.dev
Officially launched 18th May 2019
Hash Tree cpp-unordered_map

Find All Duplicate Subtrees

Given a binary tree, find all duplicate subtrees. For each duplicate subtrees, we only need to return the root node of any one of them. Two trees are duplicate if the...
Advanced Data Structure Heap Tree

Leftist Tree / Leftist Heap

A leftist tree or leftist heap is a priority queue implemented with a variant of a binary heap. Every node has an s-value (or rank or distance) which is the distance ...
Advanced Data Structure Heap Heap

Tournament Tree (Winner Tree) and Binary Heap

Given a team of N players. How many minimum games are required to find second best player? We can use adversary arguments based on tournament tree (Binary Heap). Tou...
Binary Search Tree Heap Tree

Check if a given Binary Tree is Heap

Given a binary tree we need to check it has heap property or not, Binary tree need to fulfill following two conditions for being a heap – It should be a compl...
Advanced Data Structure Technical Scripter Tree

Merge Sort Tree for Range Order Statistics

Given an array of n numbers, the task is to answer the following queries: kthSmallest(start, end, k) : Find the Kth smallest number in t...
Heap Tree Tree

Height of a complete binary tree (or Heap) with N nodes

Consider a Binary Heap of size N. We need to find height of it. Examples : Input : N = 6 Output : 2 () / () () / / () () () ...
Heap Tree tree-level-order

Given level order traversal of a Binary Tree, check if the Tree is a Min-Heap

Given the level order traversal of a Complete Binary Tree, determine whether the Binary Tree is a valid Min-Heap Examples: Input : level = [10, 15, 14, 25, 30] Output...
Linked List Tree circular linked list

Convert a Binary Tree to a Circular Doubly Link List

Given a Binary Tree, convert it to a Circular Doubly Linked List (In-Place). The left and right pointers in nodes are to be used as previous and next pointers respec...
Linked List Tree circular linked list

The Great Tree-List Recursion Problem.

Asked by Varun Bhatia. Question: Write a recursive function treeToList(Node root) that takes an ordered binary tree and rearranges the internal pointers to make a cir...
Linked List Tree doubly linked list

Create a Doubly Linked List from a Ternary Tree

Given a ternary tree, create a doubly linked list out of it. A ternary tree is just like binary tree but instead of having two nodes, it has three nodes i.e. left, mi...

Subscribe to Our Newsletter