Articles by Tag #dfs

Browse our collection of articles on various topics related to IT technologies. Dive in and explore something new!

Remove Methods from project

Problem TC: O(n*m) where n is the no. of nodes and m is the max no. of nodes/methods present in a...

Learn More 1 0Oct 6 '24

Converting Recursive Depth-First Search (DFS) to an Iterative Approach in Java

Converting a recursive Depth-First Search (DFS) to an iterative version involves replacing the...

Learn More 0 0Jul 11

Clone graph

O(n) : where n is no. of nodes Problem /* Definition for a Node. class Node { public int val; ...

Learn More 0 0Mar 20

Minimum obstacle removal to reach corner

TC:O(n*mlog(n*m)) SC :O(n*m) Problem //BFS : dijkstra's class Solution { public int...

Learn More 0 0Jan 18

Comparing BFS, DFS, Dijkstra, and A* algorithms on a practical maze solver example

Introduction Pathfinding is a fundamental topic in computer science, with applications in...

Learn More 0 0Aug 5

The DFS Copy Trap I discovered in Leetcode 113

What's the difference between paths.append(path) and paths.append(list(path)) where path is a...

Learn More 0 0May 30

3543. Maximum Weighted K-Edge Path

Problem BFS: TLE class Solution { public int maxWeight(int n, int[][] edges, int k, int t) { ...

Learn More 0 0May 21

LeetCode Flood Fill Solved — DFS Clicked at 1 AM 😴

🧩 The Problem: Flood Fill (LeetCode #733) You’re given a 2D image represented as a grid, where each...

Learn More 0 0Jul 29