摘要:
Given a string, determine if a permutation of the string could form a palindrome.For example,"code"-> False,"aab"-> True,"carerac"-> True.解法一:解题思路:The... 阅读全文
摘要:
Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.leetcode上返回类型不太一样,改编一下第三个解法:4mspublic class Solution {... 阅读全文
摘要:
Sort a linked list inO(nlogn) time using constant space complexity. 1 /** 2 * 本代码由九章算法编辑提供。没有版权欢迎转发。 3 * - 九章算法致力于帮助更多中国人找到好的工作,教师团队均来自硅谷和国内的一线大公... 阅读全文
摘要:
Reverse a linked list from positionmton. Do it in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m= 2 andn= 4,return1->4->3->2->5->NULL.No... 阅读全文
摘要:
Sort a linked list using insertion sort. 1 public class Solution { 2 public ListNode insertionSortList(ListNode head) { 3 ListNode dummy =... 阅读全文