J
Joe keane
question
We some have 'docs' that can be 'contracted' or 'expanded'.
They sometimes change from contracted to expanded and vice versa.
They each have a 'key' that's unique [and doesn't change when they
change state].
struct condocinfo { ... };
struct expdocinfo { ... };
The info for an expanded doc is a superset of the info for a contracted doc.
[e.g., pointers to more structures].
Lookup by key.
Scheme 1
We keep a hash table for all docs that contains the info for contracted
docs. We keep a hash table for only expanded docs that contains the
info for expanded docs that's not in the first one.
Scheme 2
We keep a hash table for only contracted docs that contains the info for
contracted docs. We keep a hash table for only expanded docs that
contains the info for expanded docs.
Time? Space?
[it's for an old project so it's academic]
We some have 'docs' that can be 'contracted' or 'expanded'.
They sometimes change from contracted to expanded and vice versa.
They each have a 'key' that's unique [and doesn't change when they
change state].
struct condocinfo { ... };
struct expdocinfo { ... };
The info for an expanded doc is a superset of the info for a contracted doc.
[e.g., pointers to more structures].
Lookup by key.
Scheme 1
We keep a hash table for all docs that contains the info for contracted
docs. We keep a hash table for only expanded docs that contains the
info for expanded docs that's not in the first one.
Scheme 2
We keep a hash table for only contracted docs that contains the info for
contracted docs. We keep a hash table for only expanded docs that
contains the info for expanded docs.
Time? Space?
[it's for an old project so it's academic]