Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 04 · DSA · DSA, in Hinglish · about 17 min to read

Play it as a journeyTutor comes with a plan

Foundations #02: Recursion → Memo → Table (DP ka engine)

Track: Foundations

Recursion, Memo, Table — DP Engine
Recursion, Memo, Table, DP Engine · Open board

Isi ek chhote sawaal ko, fib(n) kitna hota hai, chaar tareeke se solve karke dikhaya hai: seedha dohraav, ek likhi-hui yaadasht wala tareeka, ulta bhara hua table, aur sabse halka do-dabbon wala version.

Before you start. Foundations #01 se itna kaafi hai: jab size double hoti hai aur kaam bhi double ho jaata hai, use exponential kehte hain, aur wo bahut tezi se na-chalne-laayak ho jaata hai. Yahi doubling is lesson mein recursion ke andar chhupi milegi, dekhoge kaise.

DP koi jaadu nahi, sirf recursion + ek notebook. Ye board recursion ki basic se leke bottom-up DP tak, ek hi dhaage mein le jaata hai. Clinic #02: Climbing Stairs, Clinic #03: Coin Change, Clinic #21: Unique Paths aur Clinic #22: Longest Common Subsequence: sabhi isi engine pe chalte hain.

Lesson 30 of 96 in DSA

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • Recursion: ek sawaal jo khud ko chhota kar deta hai
  • Call stack: neeche jaate waqt peeche reh jaane wali plates
  • 1968: memoization, ek notebook jisne wahi hisaab dobara karna band kar diya
  • State: notebook kis cheez se khulti hai
  • Tabulation: notebook ko ulta bharo, plate lagti hi nahi
  • Tum ab itna jaante ho
  • Wo tree kitna bada hai, argue mat karo, gin lo
  • Chaaron versions, ek hi ghadi pe
  • Recursion kitna gehra ja sakta hai, naapo, maano mat
  • Poora bill, time aur space, chaaron versions ka
  • DP RECIPE, aur ek nayi problem pe chalake dekho
  • THE TELL, DP kab?
  • Retrieval

Terms it explains: recursion + ek notebook, recursion, base, step, plate, call stack, notebook, memoization, State, neeche se upar, tabulation, 399× ka farak, subsets, crash, 8,176 KB, OS ki limit, segfault, shunya, grow, stack space, n ≈ 9,000 (stack), Ek, do, Teen, Char, DP, top-down, bottom-up, 3 coins, 2 coins.

Review DSA