You are not logged in. Please login at www.codechef.com to post your questions!

×

Grundy Numbers

This program http://code.geeksforgeeks.org/cTn5HI is finding Grundy Numbers using recursion and memoization . Can you please explain me the recusion part of this program means like in line number 41 to whom return(Grundy[n]) is returning everytime.

asked 20 Apr '17, 01:38

anno's gravatar image

4★anno
266211
accept rate: 12%


Answer is hidden as author is suspended. Click here to view.

answered 20 Apr '17, 11:58

marshal_roxx's gravatar image

3★marshal_roxx
(suspended)
accept rate: 2%

Hey , i don't have enough karma to ask questions . I am a newbie .

link

answered 20 Apr '17, 12:41

abhi_shakes's gravatar image

0★abhi_shakes
484
accept rate: 33%

It is returning Grundy[n] because first we are storing the answer in Grundy[n]. So this just returns the answer. This storing is done so as to save ourselves from not calculating this value again and again.

link

answered 20 Apr '17, 06:48

mathecodician's gravatar image

6★mathecodician
2.6k11034
accept rate: 7%

I don't have enough Karma to ask questions. What should I do?

link

answered 20 Apr '17, 06:52

pradyumnsingh's gravatar image

0★pradyumnsingh
212
accept rate: 0%

There you are.

(20 Apr '17, 06:56) ardentcoder2★
toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×13

question asked: 20 Apr '17, 01:38

question was seen: 677 times

last updated: 20 Apr '17, 12:41