LeetCode 589 | N-Ary Tree Pre-Order Traversal | Iterative + Recursive Solution (Java + Whiteboard)

preview_player
Показать описание
Given an n-ary tree, return the preorder traversal of its nodes' values.

Running Time: O(N)
Space Complexity: O(N)

Always be pluggin:
Рекомендации по теме
Комментарии
Автор

You explain really well. Please keep up the good work!

HenggaoCai
Автор

Thanks for the video! Just wondering why we are using a LinkedList as the output as opposed to an ArrayList? Is there any benefit or just an arbitrary choice?

mounirkanane
Автор

which extension u use for dark theme in entire LC, or your browser?

NirmalSilwal
Автор

Logic OK, but How to take input and create nary tree

rajeshdudde
Автор

Great content! You are helping me understand. I am now a subscriber. I like how you explained preorder, in order, and post order. If I had to give any recommendations it would be to slow down your delivery by about 10% - 15%. Also maybe make your diagrams larger. Great content tho!

waynegreen
visit shbcf.ru