摘要: 华为2014校园招聘的机试题目 通过键盘输入一串小写字母(a~z)组成的字符串。请编写一个字符串压缩程序,将字符串中连续出席的重复字母进行压缩,并输出压缩后的字符串。 压缩规则: 1、仅压缩连续重复出现的字符。比如字符串"abcbc"由于无连续重复字符,压缩后的字符串还是"abcbc"。... 阅读全文
posted @ 2015-05-11 23:56 sunp823 阅读(508) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric: 1 /... 阅读全文
posted @ 2015-05-11 20:17 sunp823 阅读(119) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, swap every two adjacent nodes and return its head. For example, Given 1->2->3->4, you should return the list as 2->1->4->3. ... 阅读全文
posted @ 2015-05-11 19:33 sunp823 阅读(123) 评论(0) 推荐(0) 编辑