I need to create a data structure in java which can represents hierarchy of data. Example use case is shown in the image below.
In my case only the leaves level will have data, and the internal nodes should act like indexes. I should be able to get data from the data structure using multiple keys(Composite keys).
Is it okay to use nested maps, or should I implement an m way tree(B tree/B+ tree) for this use case.