feat: Finish Iteration
All checks were successful
Tests / Unit Testing1 (push) Successful in 43s

This commit is contained in:
2023-11-02 18:23:52 +01:00
parent a00e84e111
commit de2eb52756
9 changed files with 99 additions and 4 deletions

35
Iteration/Recursion.cs Normal file
View File

@ -0,0 +1,35 @@
namespace Iteration;
public class Recursion
{
public static bool IsAlphanum(string s, int i)
{
if (i >= s.Length)
{
return true;
}
else
{
if ((s[i] >= 'a' && s[i] <= 'z') || (s[i] >= 'A' && s[i] <= 'Z') || (s[i] >= '0' && s[i] <= '9'))
{
return IsAlphanum(s, i + 1);
}
else
{
return false;
}
}
}
public static string ReverseStr(string source, int lenght)
{
if (lenght == 0)
{
return "";
}
else
{
return source[lenght - 1] + ReverseStr(source, lenght - 1);
}
}
}