摘要: 奇数层从左到右打印,偶数层从右到左打印。例如:ab cd e f g输出则为 a c b d e f gView Code void SpecialPrintTrees(node root){ Node temp; Stack stack1 = new Stack(); Stack stack2 = new Stack(); stack1.Push(root); while(stack1.Count>0||stack2.Count>0) { while(stack1.Count>0) { temp = sta... 阅读全文
posted @ 2013-03-06 16:34 Ligeance 阅读(397) 评论(0) 推荐(0) 编辑
摘要: 例如"aabbccdeeef",其中eee最长,返回第一个E的位置,应该为7.View Code static int FindStartLargestRepeat(string str) { if (string.IsNullOrEmpty(str)) { throw new Exception("Input can't be empty."); } int count = 1; int maxCount = 1; ... 阅读全文
posted @ 2013-03-06 15:06 Ligeance 阅读(278) 评论(0) 推荐(0) 编辑