摘要:
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... 阅读全文
摘要:
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 阅读全文