Question: C# code in fibonacci method? 

Answer: I don't know C# but I have heard it is very simillar to Java. I am giving the Java code\n\nint Fibonacci(int n)\n{\n\nint low=0, hi=1;\n\nfor(int i=1;i<n;i++)\n{\nint tempHi=hi;\nhi=low+hi;\nlow=tempHi;\n}\n\nreturn hi;\n}\n}\n\nUsing recursion is not good. because recursive version is of order O(n^2) and has too much function call overhead.\nWhile iterative version( my one) is O(n) that is linear time.
This question from the Yahoo Q&A forum is categorized in the topic: Health