Vertical Order Traversal (Data Structures and Algorithms #15)(Binary Tree #6)

preview_player
Показать описание
This video explains How to write the Vertical Order Traversal for Binary Tree.

Time Complexity: O(n*logn)
Space Complexity: O(n)
Рекомендации по теме
Комментарии
Автор

Excellent series.... Please continue doing it!

venkateshkumar
Автор

This is much longer than other videos out there, almost borderline boring, but after going through 5-6 other videos, this is the one that finally helped me understand, good video man, thanks!

rhishhatt
Автор

why cant you use in built Queue<T> impl class?

akbarshaikh
Автор

Thanks for such detailed explanation bro.

tanyacharanpahadi
Автор

Sir, when i am trying to submit the same solution on leetcode then its giving error for this input set.
i/p : [0, 2, 1, 3, null, null, null, 4, 5, null, 7, 6, null, 10, 8, 11, 9]
[[4, 10, 11], [3, 7, 6], [2, 5, 8, 9], [0], [1]]
expected : [[4, 10, 11], [3, 6, 7], [2, 5, 8, 9], [0], [1]]

yashSharma-pedp
Автор

i didn't get the code at line 191
can someone explain it please ?

akshithkumar
Автор

why didn't i discover this channel before

sreejanagrahari
Автор

Best video..thank you for giving clear idea thoroughly, it helped me lot

vaishnaviboje
Автор

Such questions have become a cake walk after going through you're videos, thankyou sir

arpitasood
Автор

why didn't you use treeMap instead of dictionary??

SlideTackles
Автор

I think we can note down the min negative and max positive by doing preorder and run a loop while storing in a map. This way we need not sort so we can get it done in O(N) or we can maintain 1 stack for storing negative values and 1 array for positive then pop and add all elements to the back of this array? This also will be O(N).

suryaakella
Автор

very good explanation..had a hard time with this question before this video

prachurjyabasistha
Автор

Awesome video! Though a bit length the explanations were very thorough!

nagarjunprasad
Автор

sir i used this code in gfg and gfg shows your code time exceed

saurabh
Автор

Could you please explaing how to return values if the method signature is:
public IList<IList<int>> VerticalTraversal(TreeNode root) {}

krishika
Автор

Very Nice explanation.
Some places queue is referred to as stack.

sandeepkrcr
join shbcf.ru