随笔分类 - 简单数据结构
摘要: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
阅读全文
摘要: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
阅读全文

浙公网安备 33010602011771号