Data structure to handle the requirement of following use case

前端 未结 5 1731
梦谈多话
梦谈多话 2021-01-29 13:10

All the records in a database is saved in (key, value) pair formats.Records can always be retrieved by specifying key value. Data structure needs to be developed to handle follo

5条回答
  •  无人及你
    2021-01-29 13:34

    For 1 and 2, I think Linked Hash Map is a good choice.

    For the point 3, an additional Hash map with (digit, position) tuple as key and list of pointers to the values.

    Both data structures can be wrapped inside one, and both will point to the same data, of course.

提交回复
热议问题