随笔分类 -  简单数据结构

摘要:Problem D: ShellSortHe made each turtle stand on another one's backAnd he piled them all up in a nine-turtle stack.And then Yertle climbed up. He sat down on the pile.What a wonderful view! He could see 'most a mile!The ProblemKing Yertle wishes to rearrange his turtle throne to place his hi 阅读全文
posted @ 2014-01-31 10:02 ~~Snail~~ 阅读(324) 评论(0) 推荐(0)
摘要:Parentheses BalanceYou are given a string consisting of parentheses()and[]. A string of this type is said to becorrect:(a)if it is the empty string(b)if A and B are correct, AB is correct,(c)if A is correct,(A)and[A]is correct.Write a program that takes a sequence of strings of this type and check t 阅读全文
posted @ 2014-01-31 09:45 ~~Snail~~ 阅读(382) 评论(0) 推荐(0)