Time Complexity Time and Space complexity of Binary Search Tree (BST) In this article, we are going to explore and calculate about the time and space complexity of binary search tree operations.
Algorithms Average Height of Random Binary Search Tree In this post, we discuss the average height of a Random Binary Search Tree (BST) (that is 4.31107 ln(N) - 1.9531 lnln(N) + O(1)) by discussing various lemmas and their proofs. We omit full proofs and discuss the essential key points for easier understanding.
Algorithms Average height of Random Binary Tree In this article, we have explored an insightful approach/ algorithm to find the average height of Random Binary Tree which is of the order O(N^0.5). This will strengthen our understanding of binary trees and their applications.
Algorithms Average height of nodes in a Binary Tree In this article, we have explored an insightful approach/ algorithm to find the average height of nodes in the given Binary Tree. This will strengthen our understanding of binary trees and their applications.
Time Complexity Time & Space Complexity of Binary Tree operations In this article, we will be discussing Time and Space Complexity of most commonly used binary tree operations like insert, search and delete for worst, best and average case.
Algorithms Recovering a Binary Search Tree that has two nodes swapped In this article, we will be developing and implementing an algorithm that recovers a Binary Search Tree (BST) that had two of its nodes swapped accidentally.
Data Structures Scapegoat tree In this article, we will explore in detail about Scapegoat tree which is a Self Balancing Binary Tree without requiring any extra space which puts Scapegoat Tree at an unique advantage.
Algorithms List of 50+ Binary Tree Problems for Coding Interviews We have listed important Problems on Binary Tree which you must practice for Coding Interviews and listed introductory and background topics on Binary Tree as well. You must bookmark this page and practice all problems listed.
Algorithms Two Sum Problem in Binary Search Tree We have solved the Two Sum Problem in Binary Search Tree using three different approaches involving Depth First Search, Inorder Traversal and Augmented Binary Search Tree.
Algorithms Invert / Reverse a Binary Tree [3 methods] Inverting a binary tree is one of the most common questions asked in the interviews of many companies. In this article, we will see in detail as to how one can understand and tackle this task of inverting a binary tree using recursion, stack and queue.
Problems on Binary Tree Implement Binary Tree in Python We have explored the strategy to implement Binary Tree in Python Programming Language with complete explanation and different operations like traversal, search and delete.
Algorithms Types of views in Binary tree We have explored the different types of views of the binary tree (like Left, Right, Top and Bottom View) and discussed how to find them.
Algorithms Convert a binary tree into its mirror tree Given a binary tree, we have to write an algorithm to convert the binary tree to its mirror tree. A mirror tree is another binary tree with left and right children of all non-leaf nodes interchanged.
Problems on Binary Tree Construct Binary Tree from Inorder and Preorder traversal We present two approaches to Construct Binary Tree from Inorder and Preorder traversal. We start with background information on constructing Binary Tree from a given traversal or a set of traversals.
Data Structures Applications of Binary Tree Binary Tree is the most used Tree Data Structure and is used in real life Software systems. We have listed applications of Binary Tree and its variants.
Problems on Binary Tree Level order traversal of a Binary Tree In this article, we have explored Level order traversal of a Binary Tree in depth using two approaches: recursive approach and queue.
Algorithms Zig Zag Traversal of Binary Tree In this article, we present 4 different approaches for Zig Zag Traversal of Binary Tree using stack, deque, recursion and an iterative approach.
Algorithms Check if 2 Binary Trees are isomorphic Two Binary Trees are known as isomorphic if one of them can be obtained from the other one by series of flipping of nodes, swapping the children both left and right of number of nodes.
Algorithms Convert Binary Tree to Circular Doubly Linked list To convert binary tree to circular doubly linked list, we will take left node as previous pointer and right node as next pointer. The order of nodes in Doubly Linked List must be same as in inorder of the given binary tree.
Algorithms Succinct (0-1) Encoding of Binary Tree Succinct (0-1) Encoding of Binary Tree is an approach to encode a Binary Tree to the lowest possible space and maintain the structural information.
Algorithms LCA in Binary Tree using Euler tour and Range Minimum Query In this problem, we will find the Lowest Common Ancestor of a Binary Tree using Euler tour and Range Minimum Query. We can solve the LCA problem by reducing it to a RMQ problem.
Algorithms Lowest Common Ancestor in a Binary Tree In binary trees, for given two nodes a and b, the lowest common ancestor is the node of which both a and b are descendants. We explored the algorithm to find Lowest Common Ancestor in a Binary Tree.
Problems on Binary Tree Operations in Threaded Binary Tree There are three main operations which can be done on a threaded binary tree Insert, Search and Delete operation which we have explained in depth.
Problems on Binary Tree Threaded Binary Tree Threaded binary tree is a simple binary tree but they have a speciality that null pointers of leaf node of the binary tree is set to inorder predecessor or inorder successor.
Problems on Binary Tree Checking if a Binary Tree is foldable A binary tree is foldable if the left subtree and right subtree are mirror images of each other. An empty tree is also foldable. We have presented two algorithms to check if Binary Tree is foldable.