LeetCode Fibonacci Number Solution Explained - Java

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

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

  • @ethanscottt
    @ethanscottt 5 лет назад +14

    God bless you nick for always finding the best time complexity

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

      Cracking the Code Interview by Gayle McDowell illustrates this approach, but Nick's explanation is superb!

  • @RichardRajah
    @RichardRajah 5 лет назад +12

    i liked you rant towards the end... and i feel the same

  • @LazyShady
    @LazyShady 3 года назад +9

    Well, its 2021. I had this question in my intreview.

  • @majone1231
    @majone1231 4 года назад +3

    If you aren't doing functions and recursions as a beginner how would you implement fib n-1 and n-2?

    • @coffeeguy700
      @coffeeguy700 4 года назад +1

      Yeah i want know simple version before use that recursion method

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

      @@coffeeguy700 There's no other way.

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

    Is the first sum = a +b necessary (before the while loop)?

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

      No, he could have initialized sum to 0 and it would have worked the same. Its simply a place holder and gets over written by the calculation in the while loop.

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

    can u explain in o(logn)

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

    thanks nick!!!

  • @raghavendrar6189
    @raghavendrar6189 5 лет назад

    Can please explain nth prime number

  • @_VeerKumar
    @_VeerKumar Год назад

    You r such a great guy Nickkkkkkkkkkk