2 ms·
If you have a data structure like... struct item_t { char key[255]; char display_value[255]; } And your key has consistent path separato
by overgard 3y ago
If you have a data structure like...
struct item_t {
char key[255];
char display_value[255];
}
And your key has consistent path separators like a/b/c
Then looking up parents and children is incredibly easy. At worst it's a linear scan of the array, but if it's in order you can even just look at previous items in the list until you're at the parent.