ProDeveloperTutorialonJanuary 19, 2025 Binary Search Trees: Convert a BST into greater sum tree Problem Statement: You are given a root node of BST. You need to convert into a greater sum tree. Example Input: 4 / \ 3 6 Output: 6 / \ 10 0… Discover More
ProDeveloperTutorialonJanuary 19, 2025 Binary Search Trees: A program to check if a binary tree is BST or not Problem Statement: You are given a root node of a binary tree. You need to find out if a binary tree is a BST or not. Solution BST will have… Discover More
ProDeveloperTutorialonJanuary 19, 2025 Binary Search Trees: Find the Inorder predecessor and successor for a given key in BST Problem Statement: You are given BST root and a key, find the inorder predecessor and successor for that key. If the key is not found, then… Discover More
ProDeveloperTutorialonJanuary 19, 2025 Binary Search Trees: Find min and max value in a BST Problem Statement: You are given a BST root node, you need to find the max and min value. Solution To get the min value, traverse the node… Discover More
ProDeveloperTutorialonJanuary 19, 2025 Binary Search Trees: Deletion of a node in a BST Problem Statement: You are given BST root node and a key value. You need to delete that node from BST. Solution There are few cases to be… Discover More
ProDeveloperTutorialonJanuary 19, 2025 Binary Search Trees: Find a value in a BST Problem Statement: Given a BST and a key element, you need to find if the key element is present in BST or not. Solution The solution is very… Discover More
ProDeveloperTutorialonJanuary 19, 2025 Binary Trees: Find Duplicate Subtrees Problem Statement: You are given a binary tree, you need to get all the duplicate subtree. You need to return the root of the sub trees.… Discover More
ProDeveloperTutorialonJanuary 19, 2025 Binary Trees: Kth Ancestor of a Tree Node Problem Statement: You are given a binary tree, a node and an integer “k”. You need to return the kth ancestor of that node.… Discover More
ProDeveloperTutorialonJanuary 19, 2025 Binary Trees: Maximum Sum of nodes in Binary tree such that no two are adjacent Problem Statement: You are given an binary tree, you need to return the sum of the nodes such that no two nodes are adjecent. It means, if we… Discover More
ProDeveloperTutorialonJanuary 19, 2025 Binary Trees: Find largest subtree sum in a tree Problem Statement: Given a binary tree, you need to find the subtree with maximum sum in tree. Example Input : 1 / \ -2 3 / \ / \ 4 5 -6 2… Discover More