N-ary Tree Postorder Traversal - Leetcode 590 - Python

preview_player
Показать описание


0:00 - Read the problem
0:30 - Drawing Explanation
2:01 - Coding Explanation
4:04 - Drawing Explanation
7:23 - Coding Explanation

leetcode 590

#neetcode #leetcode #python
Рекомендации по теме
Комментарии
Автор

NeetCode where were you? I missed you.

jonsmith
Автор

it's not a true neetcode video if he doesn't forget to call the recursive function at the end 😂

leeroymlg
Автор

Awww man haven’t missed anyone more than you in the past week😂❤

abhishekdhyade
Автор

We definitely need this man to return today

LasTCursE
Автор

Could you solve the strange printer problem pls, it's so difficult to understand 😢

RRK
Автор

Just did this one yesterday! There's an alternative iterative solution where you also start with a stack with element root, poll all of its children nodes, and then pop it and add to the array. Then you repeat the same: pop the rightmost element, add it to the array, if there are children nodes, they are added to the tail end of the array and processed as well

So you basically perform a right-to-left pre-order traversal, then reverse the resulting array

shinjoshinjo
Автор

Where are you bro, missing your daily videos.

adilansari-hqge
Автор

Oh, hello neetcode, long time no see

tuandino
Автор

non-cs major and i had to implement this at work in java today iteratively. Extremely helpful!

pranavk
Автор

We want the simple explanation for the strange painter question which was daily question on 21st. 🙏

Crazy_J
Автор

video just uploaded now as i was going through the problem . I am lucky

Quester-xprb
Автор

You literally came after 7 days! There were literally 3 hard problems🫠

venkateshnaidu
Автор

Man I was lost for few days due to there was no video from him

varun
Автор

Thank you ! Great explanation as always!

MP-nyep
Автор

Hi, your videos has been very helpful and informative. So for yesterday's POTD can you teach us morris traversal algo

PreethamC-wp
Автор

Can someone explain me, why reverse order ?
Can we also use popleft and achieve ?
Pls help
(Just started lc)

pa-
Автор

a question. In the iterative approach, how do we make sure to pop the element from the bottom? like what he showed in the stack illustration. He popped 2 before it's predecessors.

PS: figured it out kinda, drawing was obscure.

Ryurn-gl
Автор

The iterative solution is overcomplicated. You can just do preorder and then reverse the result.

AK-kqmk
visit shbcf.ru