We have discussed Introduction to Binary Tree in set 1 and Properties of Binary Tree in Set 2. In this post, common types of binary is discussed. Following are
Given the array representation of Complete Binary Tree i.e, if index i is the parent, index 2*i + 1 is the left child and index 2*i + 2 is the right child. The
123 Graph Minimum Spanning Tree Please wait while the activity loads. If this activity does not load, try refreshing your browser. Also, this page requires java
What is Steiner Tree? Given a graph and a subset of vertices in the graph, a steiner tree spans though the given subset. The Steiner Tree may contain some verti
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 dis
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)
We encounter various problems like Maximum length palindrome in a string, number of palindromic substrings and many more interesting problems on palindromic sub
A ternary search tree is a special trie data structure where the child nodes of a standard trie are ordered as a binary search tree. Representation of ternary s
Consider a situation where we have a set of intervals and we need following operations to be implemented efficiently. 1) Add an interval 2) Remove an interval 3
BK Tree or Burkhard Keller Tree is a data structure that is used to perform spell check based on Edit Distance (Levenshtein distance) concept. BK trees are also
Prerequisites : Cartesian Tree Cartesian Sort is an Adaptive Sorting as it sorts the data faster if data is partially sorted. In fact, there are very few sortin
Background : What is centroid of Tree? Centroid of a Tree is a node which if removed from the tree would split it into a ‘forest’, such that any tree in the
Tree sort is a sorting algorithm that is based on Binary Search Tree data structure. It first creates a binary search tree from the elements of the input list o
We are given 2*N – 1 integers. We need to check whether it is possible to construct a Range Minimum Query segment tree for an array of N distinct integers fro
Prerequisite – Fenwick Tree We know that to answer range sum queries on a 1-D array efficiently, binary indexed tree (or Fenwick Tree) is the best choice (eve
Given a text txt[0..n-1] and a pattern pat[0..m-1], write a function search(char pat[], char txt[]) that prints all occurrences of pat[] in txt[]. You may assum
Write a program that converts a given tree to its Double tree. To create Double tree of the given tree, create a new duplicate for each node, and insert the dup
Given a Binary Tree, convert it to a Binary Search Tree. The conversion must be done in such a way that keeps the original structure of Binary Tree. This soluti
Inorder traversal of a Binary tree can either be done using recursion or with the use of a auxiliary stack. The idea of threaded binary trees is to make inorder
We have discussed Threaded Binary Tree. The idea of threaded binary trees is to make inorder traversal faster and do it without stack and without recursion. In
Decision Tree : Decision tree is the most powerful and popular tool for classification and prediction. A Decision tree is a flowchart like tree structure, where
Decision tree algorithm falls under the category of the supervised learning. They can be used to solve both regression and classification problems. Decision tre
Prerequisites: Decision Tree, DecisionTreeClassifier, sklearn, numpy, pandas Decision Tree is one of the most powerful and popular algorithm. Decision-tree algo