我抽象出一个我需要保存在 C 中的排序列表。一种方式最适合阅读,另一种方式最适合写作。
WRITE: search KeyNumeric then KeyAlpha and write *Data
Key1 : [ KeyA, *Data1A, KeyB, *Data1B, KeyC, *Data1C ]
Key2 : [ KeyA, *Data2A, KeyB, *Data2B, KeyC, *Data2C ]
Key3 : [ KeyA, *Data3A, KeyB, *Data3B, KeyC, *Data3C ]
READ: search KeyAlpha then KeyNumeric and read *Data
KeyA : [ Key1, *Data1A, Key2, *Data2A, Key3, *Data3A ]
KeyB : [ Key1, *Data1B, Key2, *Data2B, Key3, *Data3B ]
KeyC : [ Key1, *Data1C, Key2, *Data2C, Key3, *Data3C ]
有谁知道在内存中表示这种数据结构的最有效方法是什么?