Why is the kd-tree a main memory structure?

自作多情 提交于 2019-12-12 04:55:48

问题


I'm just wondering why the kd-tree is always considered as a main memory structure. This means that every node is kept in main memory, doesn't it?

Compared to B-trees (where every node should fit into one disk block), this doesn't make too much sense to me. Could anyone explain that? Thanks :)


回答1:


To efficiently store the tree on the disk, it should fit into 8k pages (the page size of most harddrives). With a k-d-tree this would be enormous waste, and very inefficient.

Thus, writing the k-d-tree to disk doesn't pay off.

B-trees on the other hand can be set up so that they use the whole disk page. This is important, because disks are more efficient when accessing blocks (or even better: ranges of blocks), not when randomly accessing bytes.



来源:https://stackoverflow.com/questions/28610370/why-is-the-kd-tree-a-main-memory-structure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!