摘要: Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.Soluton:/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {public: ListNode *mergeKLi... 阅读全文
posted @ 2014-03-14 19:10 xchangcheng 阅读(127) 评论(0) 推荐(0) 编辑
摘要: Given a string, determine if it is a palindrome, considering only alphanumeric(字母与数字) characters and ignoring cases.For example,"A man, a plan, a canal: Panama"is a palindrome.(不区分大小写)"race a car"isnota palindrome.Note:Have you consider that the string might be empty? This is a g 阅读全文
posted @ 2014-03-14 12:48 xchangcheng 阅读(174) 评论(0) 推荐(0) 编辑