Hi, if I have a tree of integers indexed by strings, like:
Code:
typedef struct TNode {
char *s;
int i;
TNode *Left;
TNode *Right; }
then is there any quick way to intialise it (other than simply using the standard "add to tree" algorithm n times) if the entries (s, i) are known at Compile-Time? I thought probably not because there are pointers in there whose values would not be known until Run-Time...?
Or is there some quicker way to index integers by strings?
(NOTE: I am indexing INTEGERS by STRINGS, not the other way around, or I would just use an array).