Click here to Skip to main content
15,906,624 members
Home / Discussions / C#
   

C#

 
GeneralRe: Changing the "user" configuration file Pin
Pete O'Hanlon24-Apr-13 23:51
mvePete O'Hanlon24-Apr-13 23:51 
GeneralRe: Changing the "user" configuration file Pin
Boris The Bold25-Apr-13 1:01
Boris The Bold25-Apr-13 1:01 
GeneralRe: Changing the "user" configuration file Pin
Pete O'Hanlon25-Apr-13 1:11
mvePete O'Hanlon25-Apr-13 1:11 
QuestionC# desktop runtime parameters Pin
dcof22-Apr-13 11:40
dcof22-Apr-13 11:40 
AnswerRe: C# desktop runtime parameters Pin
Clifford Nelson22-Apr-13 15:23
Clifford Nelson22-Apr-13 15:23 
GeneralRe: C# desktop runtime parameters Pin
dcof22-Apr-13 16:15
dcof22-Apr-13 16:15 
QuestionRe: C# desktop runtime parameters Pin
Clifford Nelson23-Apr-13 5:17
Clifford Nelson23-Apr-13 5:17 
AnswerRe: C# desktop runtime parameters Pin
Richard MacCutchan22-Apr-13 21:09
mveRichard MacCutchan22-Apr-13 21:09 
AnswerRe: C# desktop runtime parameters Pin
Bernhard Hiller22-Apr-13 21:11
Bernhard Hiller22-Apr-13 21:11 
AnswerRe: C# desktop runtime parameters Pin
jschell24-Apr-13 9:03
jschell24-Apr-13 9:03 
Questionvideo streaming Pin
Talal H.Daoud22-Apr-13 9:11
Talal H.Daoud22-Apr-13 9:11 
AnswerRe: video streaming Pin
Jasmine250122-Apr-13 11:17
Jasmine250122-Apr-13 11:17 
QuestionRe: video streaming Pin
ZurdoDev23-Apr-13 9:09
professionalZurdoDev23-Apr-13 9:09 
AnswerRe: video streaming Pin
Dave Kreskowiak23-Apr-13 9:30
mveDave Kreskowiak23-Apr-13 9:30 
AnswerRe: video streaming Pin
kburman624-Apr-13 6:18
professionalkburman624-Apr-13 6:18 
QuestionFibonacci sequence Pin
Sottyoru22-Apr-13 6:47
Sottyoru22-Apr-13 6:47 
GeneralRe: Fibonacci sequence Pin
harold aptroot22-Apr-13 7:23
harold aptroot22-Apr-13 7:23 
GeneralRe: Fibonacci sequence Pin
Jasmine250122-Apr-13 7:25
Jasmine250122-Apr-13 7:25 
GeneralRe: Fibonacci sequence Pin
OriginalGriff22-Apr-13 8:51
mveOriginalGriff22-Apr-13 8:51 
GeneralRe: Fibonacci sequence Pin
PIEBALDconsult22-Apr-13 15:37
mvePIEBALDconsult22-Apr-13 15:37 
GeneralRe: Fibonacci sequence Pin
Manfred Rudolf Bihy22-Apr-13 20:18
professionalManfred Rudolf Bihy22-Apr-13 20:18 
GeneralRe: Fibonacci sequence Pin
OriginalGriff22-Apr-13 21:46
mveOriginalGriff22-Apr-13 21:46 
Factorials are the "normal" example given to students to teach them recursion:
!n == n * !(n - 1) where n > 1
So factorials are naturally limiting - whatever finite number you start with, there is a termination to the sequence. (And never mind that recursion is a poor way to implement it anyway)

Fibonacci numbers on the other hand are different:
Fn = F(n-1) + F(n-2) Where F0 = 0, and F1 = 1
So instead of decreasing towards a limit, Fibonacci numbers increase to towards infinity, with no limiting condition at all to terminate them. That makes them a poor candidate for recursion, because unless an artificial outside limit such as "n < 1000" is applied as well, the recursion continues indefinitely, and the stack is compromised.

Another very poor implementation!


Thinking on this before I posted, I realised that I was wrong: the only practical way to write Fibonacci sequences as recursive functions means providing the limit first, and then calculating all the values before it, in much the same way as a factorial would be - I was thinking of it in terms of calculating the sequence from the start, without providing a limit: the sensible way since it doesn't duplicate work!
As a result, I was wrong, the stack won't self destruct. Blush | :O

It's still a silly recursion example though! Laugh | :laugh:
The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)

GeneralRe: Fibonacci sequence Pin
Manfred Rudolf Bihy22-Apr-13 22:08
professionalManfred Rudolf Bihy22-Apr-13 22:08 
AnswerRe: Fibonacci sequence Pin
PIEBALDconsult22-Apr-13 15:40
mvePIEBALDconsult22-Apr-13 15:40 
AnswerRe: Fibonacci sequence Pin
PIEBALDconsult22-Apr-13 16:02
mvePIEBALDconsult22-Apr-13 16:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.