breadth-first-search
Prolog get elements in different lists with BFS
i\'m new at prolog and to improve my skills i\'m trying to make some exercise. At the moment I\'m stuck with a BFS, let assume the tree is something like this:[详细]
2023-02-02 11:52 分类:问答Minimizing memory usage of a breadth first search
In my the following code, I am traversing a graph through breadth first search. The code constructs the graph while it is traversing. This is a very large graph, with a fan out of 12. Due to this, any[详细]
2023-01-28 03:10 分类:问答In a tree data structure, display tree nodes level by level
Question: how can we display tree nodeslevel by level ?. could you please give me time and space efficient solution .[详细]
2023-01-26 15:19 分类:问答BFS algorithm - shortest walk on grid with constrained steps
The problem is as follows: A wanderer begins on the grid coordinates (x,y) and wants to reach the coordinates (0,0). From every gridpoint, the wanderer can go 8 steps north OR 3 steps south OR 5 steps[详细]
2023-01-26 07:57 分类:问答Maze Solving using graph
Hey i was in a local programming competition and they asked me this question which i could not do so please help me on this one.[详细]
2023-01-24 19:08 分类:问答How to access the ancestor vertex during a breadth-first search with the Boost Graph Library?
I\'m trying to write my own version of connected components discovery using the breadth-first search algorithm included in the Boost Graph Library and I need to access the ancestor (the vertex which l[详细]
2023-01-20 01:48 分类:问答How can I remember which data structures are used by DFS and BFS?
I always mix up whether I use a stack or a queue for DFS开发者_如何学C or BFS. Can someone please provide some intuition about how to remember which algorithm uses which data structure?Queue can be ge[详细]
2023-01-19 18:30 分类:问答left-right BFS travesal on a binary tree
This is not a home work. I was thinking of some new questions in tree traversal and this seems to be very obvious so thought of solving it.[详细]
2023-01-19 07:05 分类:问答8-puzzle bfs scheme implementation
i was looking at implementing the bfs in scheme to solve the 8 puzzle problem, this is the code i have so far (giving some error im unable to debug)::[详细]
2023-01-18 12:45 分类:问答Why use Dijkstra's Algorithm if Breadth First Search (BFS) can do the same thing faster?
Both can be used to find the shortest path from single sourc开发者_JAVA技巧e. BFS runs in O(E+V), while Dijkstra\'s runs in O((V+E)*log(V)).[详细]
2023-01-18 04:10 分类:问答