Ok, working on a program to find the shortest path between two points. Simple.
Now, we are going to be given a list like this to denote the start and end, and then the weight of the lines.
A D
B C 31
B A 4
C A 12
C D 3
That bunch of coding produces a picture that looks like this. click here
Now. I figured I'd use something like an array to hold the points, and then have a pointer or something like that that points to each thing. Like, A -> AB = 4 & A -> AC = 12. Then I figured you'd use a stack to keep track of the direction you went (not sure if this would be needed but figured it would be the best way to handle this).
Does my pointer thing sound like a good idea or should I use a tree or something like that. Also, is there a way that I could store AB = 12 and then have it say that finding AB is also like finding BA. Basically, I think that would eliminate my need of pointers.
Thanks in advance.