rpg
| Forum | Thread | Replies | Latest activity |
|---|---|---|---|
| Tech Off | Installing C# Express on XP Virtual PC | 0 | Sep 10, 2004 at 11:38 AM |
Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
| Forum | Thread | Replies | Latest activity |
|---|---|---|---|
| Tech Off | Installing C# Express on XP Virtual PC | 0 | Sep 10, 2004 at 11:38 AM |
Gary Daniels and Evan Goldring - Mock whiteboard problem
Sep 09, 2004 at 11:47 AMpublic bool IsPalindrome(string s)
{
if(s==null) return false;
s = s.Replace(" ", "");
if(s.Length == 0) return false;
return IsPalindrome(s, 0, s.length);
}
private bool IsPalindrome(String s, int first, int last)
{
if(first >= (s.Length / 2)) return true;
if ( s[first] == s[last])
return IsPalindrome(s, ++first, --last);
else
return false;
}
Gary Daniels and Evan Goldring - Mock whiteboard problem
Aug 24, 2004 at 6:35 PMpublic bool IsPalindrome(string s)
{
//Parameter validations
if(s==null||s==string.Empty) return false ;
//replace whitespaces
s = s.Replace(" ", "").ToLower();
int len = s.Length ;
Stack ds = new Stack(len);
for(int i=0;i<len;i++)
ds.Push(s[i]);
for(int i=0;i<len;i++)
{
char c = (char)ds.Pop();
if(c == s[i])
continue;
else
return false;
}
return true ;
}