Advertisement
uopspop

Untitled

Jan 16th, 2022
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. 【觀念講解】 為什麼我們在二元樹中,沒有討論新增與刪除?
  2.  
  3.  
  4.  
  5. 因為二元樹的規範太寬鬆,只有「兩個節點」這項規範。
  6.  
  7. 對於如何「新增」與「刪除」節點沒有規則,也因此我們沒有明確規則去組成一顆二元樹。
  8.  
  9.  
  10.  
  11. 唯一可行的,就是將一個「未排序的陣列」直接「看成」一顆二元樹。
  12.  
  13. 如同我們在【觀念講解】將 Unsorted Array 視為二元樹,所學到的方式。
  14.  
  15.  
  16.  
  17. 在後續單元中,我們將學到「二元搜尋樹」,到時候就有嚴格的規範,讓我們能對亂數的原始資料進行有規律的整理。
  18.  
  19. 那休息一下,我們就繼續看下去!
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement