What could be the best data structure for storing recursive, multi-valued, and repeating paired key data?

Basically, its loading XML data, but it has the following 3 properties that need to be executed

  • repeating (a pair of key values ​​may be repeated)
  • multi-valued (one key has several meanings)

In both cases, I need to keep the data order.

+3
source share
4 answers

It depends on your complexity requirements (or the expected data complexity), but I used it once multimap<Key, list<Value> >for some project.

+1
source

I'm not a C ++ programmer, but it seems like a linked list of linked lists.

0

You can use a composite design template. This link contains some relevant information for this context.

0
source

No data structure will satisfy all of these properties. You will need to use inheritance and data mixing structures at runtime.

0
source

Source: https://habr.com/ru/post/1774886/


All Articles