@Rishi Srivastava
In mathematics, the Fibonacci numbers form a sequence, the Fibonacci sequence, in which each number is the sum of the two preceding ones. Starting from 0 and 1, the next few values in the sequence are:
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144
Formula: F(n) = F(n-1) F(n-2) {for n greater than 1}
Recursive algorithm pseudocode:
function fib(n):
if n is less than 0, then return undefined
if n is less than 2, then return n
return fib(n-1) fib(n-2)
Time complexity: O(2^n)
Space complexity: O(n) if we consider the recursive stack
ERRATA: The total time taken is not 6.7 seconds but the ms given in the output
Github:
1 view
2147
644
2 weeks ago 00:48:01 1
ИИнтервью с Достоевским
2 weeks ago 00:26:42 1
НОВАЯ ЛОВУШКА ПРИ ОБГОНЕ: 6 ЛЕТ ЛИШЕНИЯ ПРАВ, 5 опасных ловушек для водителей в ПДД 2024
2 weeks ago 01:10:57 1
Полная биография святого знатока Вед Бхактивиноды Тхакура. Часть 2.
2 weeks ago 01:12:26 1
Полная биография святого знатока Вед Бхактивиноды Тхакура. Часть 1
2 weeks ago 00:04:33 1
Новости для бухгалтера от
2 weeks ago 00:02:10 1
GTA 6 Beta | Early Access for GTA VI Beta
2 weeks ago 01:03:12 1
Киселев. Дата бомбежки Москвы, Певчих хочет забить Ходорковского молотком, Познер в могиле
2 weeks ago 00:28:44 1
Yogibo presents 見所紹介!! チャーリーガイド
2 weeks ago 00:16:44 1
Les narcissiques abusifs perdront la raison si les empathes font ces 10 choses
2 weeks ago 00:09:10 1
60 рублей за литр! Как из простых компонентов сварить качественную краску // FORUMHOUSE
2 weeks ago 00:09:35 1
Competition Preparation Checklist #2. INSIGHTS With Classical Guitarist Nikita Nedelko
2 weeks ago 00:03:03 1
“ПЕСЧИНКА“ Рассел “ТЕХАС“ Бентли и Сергей Лысенко (ЖИВЬЕ) Кино-Культ г. Донецк г.
2 weeks ago 00:05:22 1
01-02 Course content and how to use it
2 weeks ago 00:30:12 1
Музыкальный спектакль “СЛОВО“ ()
2 weeks ago 00:05:21 1
Watching You Fall
2 weeks ago 00:14:17 1
Принимает ли вас планета Земля на энергетическом уровне? Тест, адаптировались ли вы к планете Земля
2 weeks ago 00:08:31 1
“Великолепный век“ - как сейчас живут и выглядят актеры Турецкого сериала в 2024 году! (2 часть)
2 weeks ago 02:04:25 1
59_第11周——光色原理-2(直播2023-05-28)
2 weeks ago 00:07:31 1
Video
2 weeks ago 02:02:29 1
59_第11周——光色原理-2(直播2023-05-28)
2 weeks ago 00:18:26 2
The International 2024: было ли что-то хорошее? | Обзор на турнир глазами зрителя
2 weeks ago 01:08:11 1
ПОЧЕМУ НАС ПУГАЮТ И ВСЁ ЗАПРЕЩАЮТ
2 weeks ago 01:20:42 1
«Народный артист»: битва с «Фабрикой», живой звук и любовь на проекте | КАК ЭТО БЫЛО С ЯНОЙ ЧУ
2 weeks ago 00:12:25 1
Jaime Munguia vs Erik Bazinyan HIGHLIGHTS & KNOCKOUTS | BOXING K.O FIGHT HD