Priya Mannurrookiecoderblogs.hashnode.dev·Jul 19, 2024Breadth First SearchBreadth first search is used in graph algorithms for traversing through graph. It can be used to sort the graph, find cycles, solve mazes and sudokus. In this algorithm we traverse the neighbours of the nodes first and mark them down. We go on like t...DiscussBFS
Abhilietcode.hashnode.dev·Jun 30, 2024Evaluate Division - BFSYou are given an array of variable pairs equations and an array of real numbers values, where equations[i] = [A<sub>i</sub>, B<sub>i</sub>] and values[i] represent the equation A<sub>i</sub> / B<sub>i</sub> = values[i]. Each A<sub>i</sub> or B<sub>i<...DiscussGraphsBFS
Abhilietcode.hashnode.dev·Jun 30, 2024Word Ladder II - BFSA transformation sequence from word beginWord to word endWord using a dictionary wordList is a sequence of words beginWord -> s<sub>1</sub> -> s<sub>2</sub> -> ... -> s<sub>k</sub> such that: Every adjacent pair of words differs by a single letter. ...DiscussGraphsBFS
Abhilietcode.hashnode.dev·Jun 30, 2024Word Ladder - BFSExample 1: Input: beginWord = "hit", endWord = "cog", wordList = ["hot","dot","dog","lot","log","cog"] Output: 5 Explanation: One shortest transformation sequence is "hit" -> "hot" -> "dot" -> "dog" -> cog", which is 5 words long. Example 2: Input: ...DiscussGraphsgraph database
Abhilietcode.hashnode.dev·Jun 30, 2024Number of Islands - BFSGiven an m x n 2D binary grid grid which represents a map of '1's (land) and '0's (water), return the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four e...DiscussGraphsBFS
Vineeth Chivukulavineethchivukula.hashnode.dev·Jun 29, 2024Understanding Breadth-First SearchBreadth-First Search (BFS) is a traversal technique used in graph data structures that explores all the vertices at the present depth level before moving on to vertices at the next depth level. This technique is often implemented using a queue data s...DiscussBFS
Abhilietcode.hashnode.dev·Jun 27, 2024Graph - Breadth-First Search (BFS)Explain the Problem Implement the Breadth-First Search (BFS) algorithm for graph traversal. Given a graph and a starting vertex, traverse the graph in breadth-first order and print the vertices in the order they are visited. Example: Input: Graph: 0...DiscussGraphsgraph database
Akshaya Biswalakshaya-biswal.hashnode.dev·Jun 27, 2024Tree TraversalTraversing a tree means visiting every node in the tree. Types Breadth First Search (BFS) is when you visit all the nodes on one level before moving to the next level. This means you explore the tree sideways. Depth First Search (DFS) is when you g...DiscussData StructureDSA
Vineeth Chivukulavineethchivukula.hashnode.dev·Jun 25, 2024Understanding Tree Breadth-First SearchTree BFS (Breadth-First Search) is a traversal technique used in tree data structures that explores all the nodes at the present depth level before moving on to nodes at the next depth level. This technique is often implemented using a queue data str...DiscussBFS
Yung Ching KWOKyung.hashnode.dev·Jun 25, 2024Solving Puzzle: Death first search ep1https://www.codingame.com/ide/puzzle/death-first-search-episode-1 This game need to identify shortest path between 2 node. Firstly, I build a 2D array to represent a map with link 2 nodes. 0123 00110 11010 21001 30110 Next we need to find...DiscussBFS