<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FCSharp_Tutorial%2FClass%2FMethod_Recursion</id>
		<title>Csharp/CSharp Tutorial/Class/Method Recursion - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FCSharp_Tutorial%2FClass%2FMethod_Recursion"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Class/Method_Recursion&amp;action=history"/>
		<updated>2026-04-29T15:54:15Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Class/Method_Recursion&amp;diff=5607&amp;oldid=prev</id>
		<title> в 15:31, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Class/Method_Recursion&amp;diff=5607&amp;oldid=prev"/>
				<updated>2010-05-26T15:31:53Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 15:31, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Class/Method_Recursion&amp;diff=5608&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Class/Method_Recursion&amp;diff=5608&amp;oldid=prev"/>
				<updated>2010-05-26T12:16:01Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==A simple example of recursion.==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A method can call itself is called recursion.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System; &lt;br /&gt;
 &lt;br /&gt;
class Factorial {  &lt;br /&gt;
  // This is a recursive function.  &lt;br /&gt;
  public int factR(int n) {  &lt;br /&gt;
    int result;  &lt;br /&gt;
  &lt;br /&gt;
    if(n==1) return 1;  &lt;br /&gt;
    result = factR(n-1) * n;  &lt;br /&gt;
    return result;  &lt;br /&gt;
  }  &lt;br /&gt;
  &lt;br /&gt;
  // This is an iterative equivalent.  &lt;br /&gt;
  public int factI(int n) {  &lt;br /&gt;
    int t, result;  &lt;br /&gt;
  &lt;br /&gt;
    result = 1;  &lt;br /&gt;
    for(t=1; t &amp;lt;= n; t++) &lt;br /&gt;
       result *= t;  &lt;br /&gt;
    return result;  &lt;br /&gt;
  }  &lt;br /&gt;
}  &lt;br /&gt;
  &lt;br /&gt;
class MainClass {  &lt;br /&gt;
  public static void Main() {  &lt;br /&gt;
    Factorial f = new Factorial();  &lt;br /&gt;
  &lt;br /&gt;
    Console.WriteLine(&amp;quot;Factorials using recursive method.&amp;quot;);  &lt;br /&gt;
    Console.WriteLine(&amp;quot;Factorial of 3 is &amp;quot; + f.factR(3));  &lt;br /&gt;
    Console.WriteLine(&amp;quot;Factorial of 4 is &amp;quot; + f.factR(4));  &lt;br /&gt;
    Console.WriteLine(&amp;quot;Factorial of 5 is &amp;quot; + f.factR(5));  &lt;br /&gt;
    Console.WriteLine();  &lt;br /&gt;
 &lt;br /&gt;
    Console.WriteLine(&amp;quot;Factorials using iterative method.&amp;quot;);  &lt;br /&gt;
    Console.WriteLine(&amp;quot;Factorial of 3 is &amp;quot; + f.factI(3));  &lt;br /&gt;
    Console.WriteLine(&amp;quot;Factorial of 4 is &amp;quot; + f.factI(4));  &lt;br /&gt;
    Console.WriteLine(&amp;quot;Factorial of 5 is &amp;quot; + f.factI(5));  &lt;br /&gt;
  }  &lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;Factorials using recursive method.&lt;br /&gt;
Factorial of 3 is 6&lt;br /&gt;
Factorial of 4 is 24&lt;br /&gt;
Factorial of 5 is 120&lt;br /&gt;
Factorials using iterative method.&lt;br /&gt;
Factorial of 3 is 6&lt;br /&gt;
Factorial of 4 is 24&lt;br /&gt;
Factorial of 5 is 120&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Display a string in reverse by using recursion==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System; &lt;br /&gt;
  &lt;br /&gt;
class RevStr { &lt;br /&gt;
 &lt;br /&gt;
  public void displayRev(string str) { &lt;br /&gt;
    if(str.Length &amp;gt; 0)  &lt;br /&gt;
      displayRev(str.Substring(1, str.Length-1)); &lt;br /&gt;
    else  &lt;br /&gt;
      return; &lt;br /&gt;
 &lt;br /&gt;
    Console.Write(str[0]); &lt;br /&gt;
  } &lt;br /&gt;
} &lt;br /&gt;
 &lt;br /&gt;
class MainClass { &lt;br /&gt;
  public static void Main() {   &lt;br /&gt;
    string s = &amp;quot;this is a test&amp;quot;; &lt;br /&gt;
    RevStr rsOb = new RevStr(); &lt;br /&gt;
 &lt;br /&gt;
    Console.WriteLine(&amp;quot;Original string: &amp;quot; + s); &lt;br /&gt;
 &lt;br /&gt;
    Console.Write(&amp;quot;Reversed string: &amp;quot;); &lt;br /&gt;
    rsOb.displayRev(s); &lt;br /&gt;
 &lt;br /&gt;
    Console.WriteLine(); &lt;br /&gt;
  } &lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;Original string: this is a test&lt;br /&gt;
Reversed string: tset a si siht&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==fibonacci in C#==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.Reflection;&lt;br /&gt;
using System.Runtime.InteropServices;&lt;br /&gt;
public class MainClass&lt;br /&gt;
{&lt;br /&gt;
   public static void Main(){&lt;br /&gt;
      Console.WriteLine(Fibonacci(10));&lt;br /&gt;
   }&lt;br /&gt;
    static int Fibonacci(int x)&lt;br /&gt;
    {&lt;br /&gt;
        if (x &amp;lt;= 1)&lt;br /&gt;
            return 1;&lt;br /&gt;
        return Fibonacci(x - 1) + Fibonacci(x - 2);&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;89&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Recursion Count==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
   public static void Count(int InVal)&lt;br /&gt;
   {&lt;br /&gt;
      if (InVal == 0)&lt;br /&gt;
         return;&lt;br /&gt;
      Count(InVal - 1);&lt;br /&gt;
      Console.WriteLine(&amp;quot;{0} &amp;quot;, InVal);&lt;br /&gt;
   }&lt;br /&gt;
   public static void Main()&lt;br /&gt;
   {&lt;br /&gt;
      Count(3);&lt;br /&gt;
   }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;1&lt;br /&gt;
2&lt;br /&gt;
3&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>