python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
How to find end of each "wave" in BFS?
I have a Node in Graph:
struct Node {
std::string value;
Id id;
std::vector<Node*> neighbours;
}
and I've made graph iterator to do BFS (overridden map iterator). I need to find dis...
qu4lizz
Votes: 0
Answers: 1
Sliding Puzzle using BFS
I am working on Leetcode problem https://leetcode.com/problems/sliding-puzzle/
class Solution {
public:
int slidingPuzzle(vector<vector<int>>& board) {
int res = 0;
...

GigiWithoutHadid
Votes: 0
Answers: 2
How to solve KeyError in dfs, bfs
I was trying to create bfs, dfs programs by using the following python code. Unfortunately having this error...... anybody plz help for me
Traceback (most recent call last):
File "D:...\1260.py&...
Jongmin Park
Votes: 0
Answers: 1
How to use backtracking in bfs: N-Queens Problem
The problem description is as follows: The n-queens puzzle is the problem of placing n queens on an n x n chessboard such that no two queens attack each other.
Given an integer n, return all distinct ...
bloomsdayforever
Votes: 0
Answers: 0