Maximum Depth of Binary Tree | 15 min Java Coding Challenge

preview_player
Показать описание
No BGM. No intro. No fancy video editing. Just a handsome Chinese man who is going through a quarter-life crisis practicing coding questions.
Рекомендации по теме
Комментарии
Автор

谢谢大神的video,个人感觉对于bfs,space complexity是max (number of node on that level),对于一个full binary tree,space complexity是O(n/2), n=number of node in that tree, 因为最后一层node的个数是(total number of node + 1)/ 2。而如果一个binary
而对于dfs,递归深度是height of the tree,所以在同样数目的node的情况下,一个full binary tree就比较划算了。
个人见解😂

juchen
Автор

cool hat, great video! inspire me a lot

vincent-uhuo