> For the complete documentation index, see [llms.txt](https://garychang.gitbook.io/data-structure/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://garychang.gitbook.io/data-structure/lecture2-tree-and-binary-tree/lecture-2.8-advanced-trees/2.8.6-m-way-search-tree.md).

# 2.8.6 - M-Way Search Tree

m: Tree's Degree

主要用於external search及sort，因為通常資料量很大的時候，無法一次全部置於Memory中進行搜尋，需藉助外部儲存記憶體來保存Data(通常使用樹狀結構來保存)，再分批載入Memory中search。

![](https://2769815795-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LGckN3OAfinKuVIrkMj%2F-LHqSrPZ7-rSNRT0Njfo%2F-LHqUrJc1frbSUY25L1E%2F%E8%9E%A2%E5%B9%95%E5%BF%AB%E7%85%A7%202018-07-20%2015.02.33.jpg?alt=media\&token=a165b9b4-ff1a-4d7d-853b-c753b8d00329)

Tree的高度 = Disk I/O次數，若要降低樹的高度最有效的作法就是加大樹的Degree。

若一m-way search tree高度為h，求其最多節點數、最多資料數。

$$m^{0}+m^{1}+m^{1}+...+m^{h-2}+m^{h-1}=\frac{m^h-1}{m-1}個節點\ \frac{m^h-1}{m-1}\*(m-1)=m^{h}-1筆資料$$&#x20;
