Binary Tree Line by Line Level Order Traversal Time Complexity

前端 未结 0 1171
旧时难觅i
旧时难觅i 2020-11-27 15:37

Here is the Code of Level Order Traversal Line by Line. How come the Time Complexity is O(n) and not O(n2).

def levelOrder(root): queue = [root]

while          


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题