adlawson / search-algorithms Goto Github PK
View Code? Open in Web Editor NEWSearch algorithms implemented in different languages
License: MIT License
Search algorithms implemented in different languages
License: MIT License
I tried your bfs.lua code (it is high on google search for "bfs lua"). however, I'm not sure if it is entirely correct. While your test gives the expected result when the starting node is 1, just using a random other starting node doesn't give me the expected results:
Replacing 1 by 7 in your test case, I get this output
7, 4, 11, 12, 7, 8, 7, 7, 11, 12, 11, 12, 11, 12
Nodes missing (anything smaller than 7 it seems), many being duplicated; pretty sure this is not correct.
BFS fails on line 31:
Bug Bug ..!!** (ArgumentError) the Access calls for keywords expect the key to be an atom, got: 1 (elixir) lib/access.ex:329: Access.get/3 lib/bsf.ex:39: anonymous fn/3 in Bfs.frontier_adj/2 (elixir) lib/enum.ex:1826: Enum."-reduce/3-lists^foldl/2-0-"/3 lib/bsf.ex:31: Bfs.visit_frontier/3
And DFS Fails on line 22:
Bug Bug ..!!** (ArgumentError) the Access calls for keywords expect the key to be an atom, got: 1 (elixir) lib/access.ex:329: Access.get/3 lib/dfs.ex:22: Dfs.visit/3
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.