Teja Illaakadurga.hashnode.dev·Oct 2, 2024Topological Sort AlgorithmTopological sort algorithm using DFS import java.util.*; public class Main { public static class Graph { int v; int e; List<List<Integer>> arrList; public Graph(int v, int e) { this.v = v; this.e = e; arrList...DiscussTopological Sort

Teja Illaakadurga.hashnode.dev·Oct 2, 2024DFS and BFS on a Single GraphBFS and DFS Algorithm on a single Graph Take an Example of the below Graph import java.util.*; public class Main { public static class Graph { int v; int e; List<List<Integer>> arrList; public Graph(int v, int e) { this.v...DiscussDFS

Rohit Gawanderohit253.hashnode.dev·Sep 29, 2024Chapter 44: Graphs (Part 1)In this chapter, we will embark on an in-depth exploration of Graphs, one of the most versatile and widely-used data structures in computer science. Graphs play a crucial role in representing relationships between entities, making them indispensable ...DiscussDSA(Data Structure and Algorithm) In JAVAData Structures and Algorithm

Jyotiprakash Mishrablog.jyotiprakash.org·Sep 25, 2024Introduction to GraphsA graph is a collection of nodes (also called vertices) and edges that connect pairs of nodes. Graphs are an abstract data structure used to represent relationships between objects. A graph G is typically denoted as G = (V, E), where: V is the set o...Discuss·10 likes·373 readsgraphs

Dharansh Neemadharanshneema.hashnode.dev·Sep 25, 2024DFS and BFS in graph using Adjacency matrixTerminologies Graph : In DSA generally Graph means set of nodes which are connected to each other (not necessarily). A graph can be collection of nodes which are not connected to each other(disjoined graph). The graph is composed of Vertex and Edges...Discuss·10 likesGraph

Chetan Dattachetan77.hashnode.dev·Sep 23, 2024Height of a Binary Tree - Max DepthProblem Given the root of a binary tree, return its maximum depth. A binary tree's maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. (link) Example 1: Input: root = [3,9,20,null,null,15,7]...DiscussLeetcodeHeight of a Binary Tree

Chetan Dattachetan77.hashnode.dev·Sep 21, 2024Binary Trees | Types | BFS | DFSIntroduction Arrays and linked lists are flat structures, whereas a tree is a hierarchical structure. If a tree has only 2 children, then it is called a binary tree. Terminology Root: The head of the tree is called the root node. Leaf node: A n...DiscussLeetcodetraversals

Chetan Dattachetan77.hashnode.dev·Sep 6, 2024Word SearchProblem Given an m x n grid of characters board and a string word, return true if word exists in the grid. The word can be constructed from letters of sequentially adjacent cells, where adjacent cells are horizontally or vertically neighboring. The s...DiscussLeetcodeword-search

Prashant Pathakppathak.hashnode.dev·Aug 20, 2024How to Perform Depth-First Search (DFS) on HTML NodesTrying to traverse HTML nodes in DFS approach, written a JavaScript function to traverse HTML node in DFS approach. Although i can't find any real use of DFS traverse in html node on Front End because in modern render framework React, Angular. We use...Discuss#DFSinHTML

Vineeth Chivukulavineethchivukula.hashnode.dev·Jul 5, 2024Solving Path SumTo see the question, click here. Naive Approach The idea is to maintain two stacks nodeStack and sumStack . Until nodeStack is empty; if it's a leaf node and the current sum equals 0, we found a path. Process the right child by pushing it onto the no...Discuss112. Path Sum