开发者

Big O of pre order traversal, in order traversal ,post order, level order for tree

开发者 https://www.devze.com 2023-01-20 16:39 出处:网络
Please let me know the Big Oh of the above开发者_如何学编程.Think about how an algorithm executing these traversals would look like - what data structure would you use (stack, queue, something else?)

Please let me know the Big Oh of the above开发者_如何学编程.


Think about how an algorithm executing these traversals would look like - what data structure would you use (stack, queue, something else?) and how many operations would you need to execute for processing each node in the tree? Would you ever have to process a node in the tree twice at all?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号