Count Complete Tree Nodes (LeetCode 222) | Complete tree examples | Recursive & Iterative

Поделиться
HTML-код
  • Опубликовано: 3 окт 2024

Комментарии • 16

  • @vipulaggarwal8518
    @vipulaggarwal8518 4 месяца назад +2

    your voice is so pleasant to our ears and your way to explain the approach and code is absolutely fantastic. Thanks for the content you gave us !😊😇

  • @navyanavilu2639
    @navyanavilu2639 3 месяца назад

    Well explained. Thank you!

  • @jagicyooo2007
    @jagicyooo2007 7 месяцев назад

    so concise!

  • @AcashBrands
    @AcashBrands 7 месяцев назад

    Nice explanation sir ❤❤

  • @udayrajvadeghar8555
    @udayrajvadeghar8555 7 месяцев назад +1

    Fire content :)

  • @sunilkumawat7959
    @sunilkumawat7959 3 месяца назад

    By looking at your code :
    T(n) = 2 T(n/2) + k, It gives nlog(n) time complexity.
    Please correct me if I am wrong

  • @luminraja09
    @luminraja09 4 месяца назад

    So 1 is for the root node of the subTree / main tree ?

  • @jritzeku
    @jritzeku 5 месяцев назад

    Is there a way to add own test cases and see expected output on Leetcode? I feel like this would be helpful feature because the examples provided generally cover few edge cases only.
    I think I've seen some one create test case tree via comments and the run test for that.
    ex: check if following is valid BST, resulting in false
    /*
    1
    / \
    2 3
    */

    • @nikoo28
      @nikoo28  5 месяцев назад +1

      if you click the 'Console' window on leetcode, it allows you to pass custom test cases

  • @tanishkaagarwal6750
    @tanishkaagarwal6750 7 месяцев назад

    sir, please make a solution video on Next Permutation problem . Leetcode 31

    • @mhmd5ld81
      @mhmd5ld81 6 месяцев назад

      Tbh that question chases me in my dreams XD

    • @nikoo28
      @nikoo28  6 месяцев назад

      sure, I will add it to my pipeline of videos.

  • @khushaldodeja8267
    @khushaldodeja8267 6 месяцев назад +1

    Is there anyone facing issue imagining how recursion works?

    • @khushaldodeja8267
      @khushaldodeja8267 6 месяцев назад

      could you dry run this question

    • @nikoo28
      @nikoo28  6 месяцев назад +3

      I will do a video on dry running a recursive problem.

    • @solzerid
      @solzerid 5 месяцев назад +1

      This is one of the hurdles that make a huge difference in your ability to solve problems. Take some time to focus on recursion. Look at various simpler recursive problems until you can start to see patterns and visualize how it works. Once you can visualize recursion it will be a quantum leap forward in your programming skills. There are a lot of milestones like this, just try not to get discouraged and keep finding material on the subject until it clicks. You'll eventually have enough practice or find the perfect lesson for you that will make it 'click'.