Tail recursion/Tail-Call Optimization | Recursion in programming |DS & Algorithm| Gate Appliedcourse

Поделиться
HTML-код
  • Опубликовано: 8 май 2019
  • Chapter Name: Recursion in programming
    Refer: en.wikipedia.o...
    Please visit: gate.appliedro...
    For any queries you can either drop a mail to Gatecse@appliedroots.com or call us at +91 844-844-0102

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

  • @julienbongars4287
    @julienbongars4287 4 года назад +2

    underrated channel and great video! Looking forward to watching more (But not tonight, don't want to dive too deep into the rabbit hole...)

  • @preethamm.s6095
    @preethamm.s6095 4 года назад +3

    Awesome explanation, thank you.
    One new subscriber added to your channel xD

  • @letojoker8984
    @letojoker8984 4 года назад

    your explanation is detailed and clears doubt compared to others videos regarding the same topic.

  • @iulianbojinca7309
    @iulianbojinca7309 4 года назад +2

    Thank you for the explanations. Very clear and nicely explained. There is a red flag here for Java and .NET developers. Correct me if I'm wrong and this has changed in recent versions. But at least 2 years ago, for Java 8, this tail call optimization (TCO) was not implemented for the compiler.

  • @bhaveshshah9487
    @bhaveshshah9487 3 года назад +1

    beautifully explained! Thanks!

  • @nagavedareddy5891
    @nagavedareddy5891 3 года назад

    Nice Explanation, Thanks : )

  • @mayankpatel5437
    @mayankpatel5437 2 года назад

    Amazing ❤️❤️

  • @jamesgomatos5087
    @jamesgomatos5087 4 года назад

    great explanation!

  • @barshapal_1227
    @barshapal_1227 3 года назад

    thanku very much

  • @Christobanistan
    @Christobanistan 2 года назад

    It seems to me that rather than write your code to compiler optimizations, you should just write this algorithm iteratively.

  • @OmarAbdelaziz__47
    @OmarAbdelaziz__47 4 года назад

    Thank you man, well explained!

  • @Jaspreetsingh-ux6lo
    @Jaspreetsingh-ux6lo 3 года назад

    Nice

  • @mehdi-vl5nn
    @mehdi-vl5nn 2 года назад

    tail recursion example is not a tail recursion at all
    a = f(n-1)
    return n* a

  • @aadil4236
    @aadil4236 3 года назад

    But how the space complexity is O(n) doesn't it needs memory to store other recursive calls??

    • @jl_woodworks
      @jl_woodworks 2 года назад +1

      No. Because the function behaves pretty much as a goto statement instead of allocating another function call into the stack. It's pretty cool.

    • @aadil4236
      @aadil4236 2 года назад

      so it's just something the compiler does on its own? And I mistyped space complexity in my query, which Should be O(1).
      Thanks for the clarification.

    • @jl_woodworks
      @jl_woodworks 2 года назад

      @@aadil4236 The compiler needs to know it's tail-call recursion in order to optimize its compilation process, yes.

    • @aadil4236
      @aadil4236 2 года назад

      thanks dude, your explanation really helped.

  • @zhengcao6529
    @zhengcao6529 3 года назад +1

    Stop repeating yourself man

    • @GATEAppliedCourse
      @GATEAppliedCourse  3 года назад +1

      Thank you for your suggestion. We will surely improve.