Wehavehere a functionthat's almostexactlythesameaswhatwehadearlier, exceptforthesethreelinesonthefirstthingtonoticeherewiththepreviousfunctionwehadisthatthey'reonLee n timesseepossiblevariablepairsthatwecouldhave.
Andwhatwe'redoinghereiswe'restoringtheresultsofthisfunctionin a twodimensionalraywiththeheightandandwith C ondhereinitializeittooundefinedtheoutsidefunction.
Sowegothroughthiswholething a mostandtimeseetimesandeverytimewegothroughthisfunction, themaximumnumberofrecursivecallswemakeisjusttwiceinthiscase, thisoneandthisone.
Sothemaximumnumberoftimeswecallthisfunctionitselfisabouttwotimesandsee, orjustonorderoff N.
C onthetimeittakestoexecuteeachcallortimepercallisjust a constanttime.
Sothetotalamountoftimeittakestoexecutethiswholethingisjustanorderoff N.