摘要: 题目:The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integernrepresenting the total number of bits in the code, print the sequence of gray code. A gray code sequence must begin with 0.For example, givenn= 2, return[0,1,3,2]. Its gray cod 阅读全文
posted @ 2013-12-15 16:43 月窟仙人 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 题目:A message containing letters fromA-Zis being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message containing digits, determine the total number of ways to decode it.For example,Given encoded message"12", it 阅读全文
posted @ 2013-12-15 15:32 月窟仙人 阅读(139) 评论(0) 推荐(0) 编辑