Tell me please, is there such a data structure for storing multidimensional information, with the complexity of searching for O (log n) or O (1)?
The complexity of adding, removing, or modifying elements is not so unimportant.
Tell me please, is there such a data structure for storing multidimensional information, with the complexity of searching for O (log n) or O (1)?
The complexity of adding, removing, or modifying elements is not so unimportant.
R-tree,
R*-tree,
Hilbert R-tree
and other variations of Spatial Data Structures.
For the
R-tree,
for example, the algorithmic complexity of theSEARCH,
operationSEARCH,
which is performed inO(lgN)
with degradation toO(N)
in the case ofMinimum Bounding Volumes
overlapping of the inserted objects, is proved.In practice, as far as I know, the case with degradation to
O(N)
is not very common.
Minimum Bounding Volume,
" you can come up with a hash function for your objects and insert them into one hash table.However, as intuition tells me, it’s not about that.
----------------------------
| ---------------- |
| ---------------- |
| | ---- | |
| | | | | |
| | ---- | |
| | | |
| ---------------- |
| |
----------------------------
- Costantino RupertYou can at least include structures with the desired difficulty of searching each other. For example:
megamap = HashMap<Координата1, HashMap<Координата2, Значение>>() megamap.get(X).get(Y) - получить значение
If the number of coordinates in your multidimensional structure is fixed (in Example 2), then asymptotically the speed will remain the same.
found an interesting report on a similar topic of MMRO - On optimizing the search for multidimensional data in recognition
Source: https://ru.stackoverflow.com/questions/191006/
All Articles