Aman Pratap Singhamanps12.hashnode.dev·Dec 1, 2024Know About Binary Search TreeIntroduction Binary Search Trees (BSTs) are a specialized form of binary trees designed to optimize the searching process. While a standard binary tree offers no inherent structure to facilitate faster lookups, BSTs introduce a pivotal property: for...10 likesBinaryTrees
Karelle Hoflerkarellehofler.hashnode.dev·Oct 18, 2023Explanation for Leetcode 230: Kth Smallest Element in BST - Solution Code in Java and JavaScriptThis intermediate Leetcode problem may seem challenging but it's not once you understand the traversal and the basics of binary search trees. To solve this problem you would have to do an in-order traversal. If you're not familiar with traversing a b...5 likesleetcode-solution
Kallol Bairagikallolbairagi.hashnode.dev·Oct 16, 2023#235.Lowest Common Ancestor of a Binary Search Tree [LeetCode Grind 75 in Java]class Solution { public TreeNode lowestCommonAncestor(TreeNode root, TreeNode p, TreeNode q) { //check on the left side if(root.val > p.val && root.val > q.val) return lowestCommonAncestor(root.left, p, q); //c...LeetCode Grind 75 in JavaDSA
Miradil Zeynallimmzeynalli.hashnode.dev·Oct 13, 2023Solving DSA Problems. Eolymp 4036 & 4038: Pre-Order/Post-Order Traversal of a TreeProblem statement These are two identical problems: Eolymp 4036 and 4038. The following problem statement is that of 4038, but explanation covers both problems. Given an array of integers. Create a Binary Search Tree from these numbers. If the inse...DSA
Abdul Ahad Sheikhpgdacmate.hashnode.dev·Jul 8, 2023PGDAC | Data Structures and Algorithms | Binary Search Tree Part-1Introduction In this blog, we will be looking into a data structure called Trees. A tree data structure is a hierarchical structure that is used to represent and organize data in a way that is easy to navigate and search. It is a collection of nodes ...68 readsDSAPGDAC