Hi Folks,
I strucked up in choosing a data structure for a following requirement.
The application should accept rules from user like
1 A = 2 B
1 B = 2 C
1 D = 4 E
5 X = 10 Y
5 Y = 3 C
1 E = 3 C
and a question from user like
3 X = ? A .. like so
My thoughts:
First I read all those data and create structure array like
struct data
{
int val1,val2;
char *name1,*name2;
}Objs;
Then I assign Objs.val1=1 Objs.val2=2 strcpy(Objs.name1,"A")
strcpy(Objs.name2,"B").
Now I thought of creating a graph and use some prims or kruskals algs .
or
after scanning the question , shall I scan the structures arrays again and
calculate ?
Can you please suggest some good structure and algorithm to use ?
Thx,
--Gopi
Add more friends to your messenger and enjoy! Go to
http://messenger.yahoo.com/invite/
[Non-text portions of this message have been removed]