Re: Still in awe over HP50g Message #2 Posted by Vieira, Luiz C. (Brazil) on 15 Aug 2010, 6:23 p.m., in response to message #1 by Glenn Shields
Hi, Glenn;
I wrote a small recursive program (recursive programs tend to be small while doing big things...) for DFS - Depth-First Search - using matrix representations for graphs. I still need to refine it because it has some parts that might be reduced, but it calls itself each tine a vertex is found in a branch being searched. Because it uses local and global variables and it is not optimized, searching takes a lot of time and adding new branches causes the program to take some considerable extra time. It does not use Dijkstra's algorithm, the idea is just to show that it must test all possibilities, not only the shortest path.
I wrote it to show my students that if an HP50G could handle DFS with such a small code, they would be able to do that with Delphi easily.
Itīs been two years and none of them has yet beaten my listing...
User RPL is amazing, ahn?
Cheers.
Luiz (Brazil)
Edited: 15 Aug 2010, 8:13 p.m.
|