Print diagonal elements in binary tree(code/Algorithm/Program)

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ก.ย. 2024
  • Traverse through the diagonal elements in a binary tree.

ความคิดเห็น • 65

  • @milimishra6447
    @milimishra6447 7 ปีที่แล้ว +4

    sir ..u r d only one i found till now who covered these topics of binary tree...thanks alottt...

  • @RaviKumar-vk6ib
    @RaviKumar-vk6ib 3 ปีที่แล้ว +1

    You are an excellent teacher keep up the good work god bless you

  • @dharanyuvi6951
    @dharanyuvi6951 2 ปีที่แล้ว

    Brother thanks for such a clear explanation.., kudos to you

  • @MrKumarrohan
    @MrKumarrohan 4 ปีที่แล้ว

    Thanks you so much sir for the best explanation ever for diagonal elements. Haven't found better explanation than this.

  • @momog7312
    @momog7312 4 ปีที่แล้ว +2

    This video is great! Nice explanation and clear algorithm! Thank you!

  • @niketkumar7777
    @niketkumar7777 7 ปีที่แล้ว

    Bhai.. good approach..Till now i was doing it recursively and finding ways to do it iteratively.. great Man..

  • @rishigoley3521
    @rishigoley3521 7 ปีที่แล้ว +3

    BEST SOURCE TO LEARN ALGOS

  • @ShabnamKhan-cj4zc
    @ShabnamKhan-cj4zc 6 ปีที่แล้ว

    Thanks a lot for simple explanation and visiting each every node to show logic.Thanks again.

  • @hiteshusingh8571
    @hiteshusingh8571 3 ปีที่แล้ว

    Nice explanation Sir

  • @theWrongInsights
    @theWrongInsights 3 ปีที่แล้ว

    love you sir!!! kya smjhate ho tussi!!....

  • @prashantgiri1285
    @prashantgiri1285 3 ปีที่แล้ว +1

    Hey, Sir, I am following you for the past 1 year and your videos are very easy to understand and it gives me a lot of confidence to work on.
    I would ask for your help to create a placement series where we would get the 100 best questions discussion covering the entire topic of DS Algo and if that works on. We will be surely hitting big companies on campus for sure.
    ThankYou
    Prashant Giri
    Jadavpur University

  • @akashninave5001
    @akashninave5001 3 ปีที่แล้ว

    BEST EXPLAINATION, THANK YOU, SIR

  • @shristisingh6539
    @shristisingh6539 ปีที่แล้ว

    very nice explanation..literally

  • @vm1662
    @vm1662 4 ปีที่แล้ว

    You explain so well!!!!! Superb!! Thank you :)

  • @milimishra6447
    @milimishra6447 7 ปีที่แล้ว +2

    the way u teach is also very gud....

  • @subhalakshmikumarappan8806
    @subhalakshmikumarappan8806 6 ปีที่แล้ว

    Very clear and easily understandable..!!!

  • @SahilJSawant
    @SahilJSawant 6 ปีที่แล้ว +4

    At 22:34 don't you think the traversal should be "dij" instead of "dji"
    btw nice tutorial sir

  • @parmeziaaanoocheese2312
    @parmeziaaanoocheese2312 7 ปีที่แล้ว

    great helped in a lot of interviews sir

  • @rohansodha9555
    @rohansodha9555 3 ปีที่แล้ว

    Excellent !

  • @AddieInGermany
    @AddieInGermany 7 ปีที่แล้ว +1

    Sir you're THE best

  • @LarryRuane
    @LarryRuane 7 ปีที่แล้ว

    Beautiful algorithm! I would not have thought of code this elegant. I'm just curious, did you think of this algorithm by yourself? Or is this a previously-known algorithm (that you have presented so clearly)?

  • @shyammahato7178
    @shyammahato7178 4 ปีที่แล้ว

    nice explanation.. thanku sir

  • @MsSk8trboy
    @MsSk8trboy 5 ปีที่แล้ว

    Great explanation mahn ..... Keep it up

  • @jatinbansal9347
    @jatinbansal9347 4 ปีที่แล้ว

    sir I think more easy way is to use map concept as you have used in vertical order traversal.

  • @hymnish_you
    @hymnish_you 4 ปีที่แล้ว

    Awesome yaar, keep doing!

  • @Sushil2874
    @Sushil2874 4 ปีที่แล้ว

    Great explanation..!!

  • @nakulamate3558
    @nakulamate3558 3 ปีที่แล้ว

    what is the time complexity of the solution?

  • @vaibhavkumar903
    @vaibhavkumar903 7 ปีที่แล้ว

    kudos!! You made it look simple :)

  • @kumarparth444
    @kumarparth444 4 ปีที่แล้ว +1

    sir please upload more problems of binary tree

  • @naanchilnanban
    @naanchilnanban 6 ปีที่แล้ว

    Yours video simply super. Can you please help me how to traversal a full binary tree in circular spiral (not in zigzag way).

  • @prashantverma3347
    @prashantverma3347 4 ปีที่แล้ว

    thank you

  • @travelogue4566
    @travelogue4566 7 ปีที่แล้ว

    nice explanation

  • @gurupreetsingh8347
    @gurupreetsingh8347 4 ปีที่แล้ว

    sir , plz tim sorting pe details video bana ke samjyo do

  • @premprakash8220
    @premprakash8220 6 ปีที่แล้ว

    nice explanations

  • @abrahamwilliam1260
    @abrahamwilliam1260 6 ปีที่แล้ว

    By this method u can solve in O(N) and not itn O(n^2)
    public static void Diagonal(Node root, Map h){
    LinkedList q= new LinkedList();
    q.add(root);
    while(!q.isEmpty()){

    // for(int i=0;i

  • @siddharthsethia5986
    @siddharthsethia5986 6 ปีที่แล้ว

    Good One sir!

  • @ShivangiSingh-wc3gk
    @ShivangiSingh-wc3gk 6 ปีที่แล้ว

    beautiful

  • @SuyashSoni248
    @SuyashSoni248 6 ปีที่แล้ว

    Why do we need to explicitly specify a condition -
    If (p == null) break;
    The outer loop will anyway end as queue becomes empty at the last. Here is the implementation in Python -
    github.com/suyash248/ds_algo/blob/master/Tree/printDiagonals.py

  • @avikool1
    @avikool1 6 ปีที่แล้ว

    Great. Thanks!

  • @saniltalauliker351
    @saniltalauliker351 6 ปีที่แล้ว

    With each algorithm you discuss, will you also please provide examples of best and worst time complexity for the same

  • @somurauniyar2610
    @somurauniyar2610 4 ปีที่แล้ว

    sir thanks a lot ......

  • @piyushranjan3075
    @piyushranjan3075 5 ปีที่แล้ว

    Mind blowing algorithm

  • @tsupreetsingh
    @tsupreetsingh 4 ปีที่แล้ว +1

    thanks bruh

  • @ArpitDhamija
    @ArpitDhamija 4 ปีที่แล้ว +1

    its - d,i,j not d,j,i

  • @yilinyao1999
    @yilinyao1999 5 ปีที่แล้ว +2

    讲的很好就是口音真的没字幕听不懂。

    • @vedantdeshmukh1778
      @vedantdeshmukh1778 ปีที่แล้ว +1

      如果没有翻译,您的评论会更加不全面。顺便问一下,你好吗?

  • @srinidhiii
    @srinidhiii 7 ปีที่แล้ว

    thank you sir

  • @vivekoberoi06
    @vivekoberoi06 5 ปีที่แล้ว

    Great explanation. Please avoid saying bad about other websites, it doesn't give out a good impression. People will give you the credit for the amazing videos anyway. Thanks from your well wisher

  • @brijpatel237
    @brijpatel237 3 ปีที่แล้ว

    thanks god :-P

  • @coderajput1816
    @coderajput1816 7 ปีที่แล้ว

    where is its program

  • @kasa007
    @kasa007 6 ปีที่แล้ว

    Sir....I could be able to find this whole program on ur github account

    • @amitkumarsingh5414
      @amitkumarsingh5414 4 ปีที่แล้ว

      void diagonalDistanc(Node * root, int d, map &v ){
      if(!root) return;
      v[d].push_back(root->data);
      diagonalDistanc(root->left, d+1, v);
      diagonalDistanc(root->data,d,v);
      }
      Rest you can print it.

  • @igaming_
    @igaming_ 2 ปีที่แล้ว

    Very difficult

  • @veerrajuyeleti8541
    @veerrajuyeleti8541 7 ปีที่แล้ว

    sir could you upload on find the node in a binary tree having duplicate subtrees

    • @vivekanandkhyade
      @vivekanandkhyade  7 ปีที่แล้ว

      yes sure Veerraju.

    • @vivekanandkhyade
      @vivekanandkhyade  7 ปีที่แล้ว +2

      Hey VeerrRaju.....did u check the diagonal elements of a binary tree video.....u had asked for it....i m very happy to help u with that video.

    • @veerrajuyeleti8541
      @veerrajuyeleti8541 7 ปีที่แล้ว

      sir i checked it

    • @harshgupta9761
      @harshgupta9761 3 ปีที่แล้ว

      @@vivekanandkhyade sir diagonal traversal is not uploaded on your github account

  • @nayankurude6369
    @nayankurude6369 7 ปีที่แล้ว

    13:02 You missed out on marking u as 2.