public static bool IsPalindrome(string word) { StackMy <string> stackMy = new StackMy <string>(); for (int i = 0; i < word.Length; i++) { stackMy.Push(word.Substring(i, 1)); } for (int i = 0; i < word.Length; i++) { if (word.Substring(i, 1) != stackMy.Pop()) { return(false); } } return(true); }
public static string ConvertPositiveIntegerFromDecimalToOtherForms(int num, int form) { StackMy <int> tempData = new StackMy <int>(); if (num == 0) { return(0.ToString()); } while (num != 0) { tempData.Push(num % form); num = num / form; } string temp = null; while (tempData.Count > 0) { temp += tempData.Pop() + " "; } return(temp); }