shortest path

hello everyone. I am trying to find the shortest path to reach at a certain point.I have written the fist part of the code but I cant go further. Well my source code so far is this :

#include <iostream>

using namespace std;

int main()
{
int smallest = 0;
int Array[] = {'AC','AF','CF','FE','CD' , 'DB', 'FE', 'EB','DE', 'FD' , 'CE'};
Array[0] = 5;
Array[1] = 9;
Array[2] = 3;
Array[3] = 1;
Array[4] = 4;
Array[5] = 6;
Array[6] = 1;
Array[7] = 2;
Array[8] = 1;
Array[9] = 1;
Array [10] = 3;
Array [11] = 2;

for (int i=1; i<Array[i];i++)
{
if (Array[0] > Array[1])
cout<<"AF is smaller with :"<<Array[1]<<endl;
else
cout<<"AC is smaller with: "<<Array[0]<<endl;

}

system ("pause");
return 0;
}






Now I have to compare 3 elements of the array. Element 2,4 and 11 but I can't do it to work properly.I know there is an algorithm called dijkstra to implement this kind of problem but I have to do it that way.
Topic archived. No new replies allowed.