Saurabh vermaedunode.hashnode.dev·Dec 24, 2023DFS in Binary TreeBinary tree is a non-linear data structure.Basically a hierarchical data structure composed of nodes, where each node has at most two children, referred to as the left child and the right child. The top node of the tree is called the root. So in Bina...Discuss·2 likesBinary Search Algorithm
Zenith20zenith20.hashnode.dev·Oct 27, 2023Build Your Own Maze Generator In JavaScriptIf you'd like to watch the process in a video you can check it out below . 👇 https://youtu.be/UnKvDZ7wqUY Introducing Mazes Mazes are all fun and games, and there's something in all (probably not all) of us which makes us greedy to solve a maze pu...Discuss·37 readsDFS
Kallol Bairagikallolbairagi.hashnode.dev·Oct 8, 2023#543.Diameter of Binary Tree [LeetCode Grind 75 in Java]class Solution { private int diameter = 0; //diameter is longest length between any two nodes public int longestLen(TreeNode node){ if(node == null) return 0; //longest length on the left subtree and right subtree ...DiscussLeetCode Grind 75 in JavaDSA
Ramandeep Singhramandeepsingh.hashnode.dev·Sep 17, 2023Binary Lifting - Calculating the Lowest Common AncestorHello everyone, I hope you are doing great, I am back with another blog in which I discussed a common category of problems involving trees, the problems seem tricky at first but solving these problems with the technique explained below becomes really...Discuss·146 readsTree
Anton Yarkovoptiklab.hashnode.dev·Sep 16, 2023Universal implementation of BFS, DFS, Dijkstra and A-Star algorithmsIt turns out that well-known algorithms like BFS, DFS, Dijkstra, and A-Star are essentially variations of the same algorithm. In other words, it is possible to implement a universal data structure that can switch between these algorithms without requ...Discuss·42 readsBFS
PatientRent8401truthaniket.hashnode.dev·Aug 2, 2023Dfs (depth First Search)We Will consider the below example to solve DFS traversal. I assume you have prior knowledge of how DFS works. node = ["a", "b", "c", "d", "e", "f", "g"] edges = [["a", "b"], ["b", "c"], ["b", "e"], ["c", "d"], ["c", "e"], ["e", "g"], ["f",...Discuss·10 likes·50 readsDFS
Uzmauzma.hashnode.dev·Jul 31, 2023Binary Search TreeA binary search tree (BST) is a binary tree in a symmetric order, where each node has a key (and an associated value). A binary tree means it consists of nodes, and each node has at most two children(left and right child). While being in a symmetric ...Discuss·1 likebinary search
Balaji BatchuforDSA Blogbalaji-dsa.hashnode.dev·Jul 10, 2023Minimum Depth of Binary TreeProblem Statement: Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node. Note: A leaf is a node with no children. Example 1: Input: root = [3,9...DiscussBeginner Developers
Aswin Lalaswnss.hashnode.dev·Jun 28, 2023Implementing Depth-First Search (DFS) Algorithm in Python: A Comprehensive GuideAlgorithm Create a function called DFS with a starting vertex as the parameter. Initialize an empty stack and an empty set to keep track of visited vertices. Push the starting vertex onto the stack. While the stack is not empty, do the following:...Discuss·85 readsDFS
khandoker ananblog.khandokeranan.com·May 6, 2023Finding the shortest path with topological sort in Directed Acyclic GraphIntroduction In a directed acyclic graph (DAG), a topological sort is a linear ordering of the vertices such that for every directed edge, the vertex u comes before v in the ordering. This ordering can be used to find the shortest path between two ve...Discuss·4 likes·147 readsDFS