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

  • @niketandoddamani1093
    @niketandoddamani1093 18 дней назад

    Perfect ! to the point thanks for the code walk through and the recursion tree

  • @SamirKumarRakshit-c4z
    @SamirKumarRakshit-c4z 18 дней назад +2

    Perfectly expanded

  • @gauravsingh-mf9qf
    @gauravsingh-mf9qf 18 дней назад +1

    excellant ek bar dekh ke smjh aa gaya

  • @AR_--007
    @AR_--007 18 дней назад +1

    Really great explanation !

    • @techdose4u
      @techdose4u 18 дней назад +1

      Glad you liked it!

  • @JiyaRana-w7m
    @JiyaRana-w7m 15 дней назад

    Perfect i understand thank u sir

  • @rishabh._.raj1
    @rishabh._.raj1 18 дней назад +1

    Recursion will take stack space, this isn't an O(1) solution

    • @techdose4u
      @techdose4u 18 дней назад

      1. You can convert the logic to iterative code.
      2. The depth is only max 5 hence can be taken constant.

    • @rishabh._.raj1
      @rishabh._.raj1 18 дней назад

      @@techdose4u True got it

  • @AnuragKumar-jo4li
    @AnuragKumar-jo4li 18 дней назад

    really good video

  • @PreyumKumar
    @PreyumKumar 18 дней назад

    depth will change acc. to number.

    • @techdose4u
      @techdose4u 18 дней назад +1

      depth will change in LogBase10 order.
      Since, problem mentions constraints to be very low hence we can ignore Call stack.
      Else, you can convert this logic to iterative approach :)

  • @nikhilaggarwal9325
    @nikhilaggarwal9325 18 дней назад

    please provide java code as well.

    • @Sehnaaz-vf7md
      @Sehnaaz-vf7md 18 дней назад

      The Java solution:
      class Solution {
      public List lexicalOrder(int n) {
      List ans= new ArrayList();
      for(int i =1; in){
      return;
      }
      ans.add(Current);
      //Generate the next number to add and check whether it exceeds the limit 'n'
      //remember the recursive tree while coding refer RUclips TechDose 386
      for(int i=0;i n){
      return ;
      }
      dfsHelper(next,n,ans);
      }

      }
      }

    • @techdose4u
      @techdose4u 18 дней назад

      Thanks :)