2015年5月18日

摘要: 题目:Sort a linked list inO(nlogn) time using constant space complexity.代码:/** * Definition for singly-linked list. * struct ListNode { * int val; *... 阅读全文
posted @ 2015-05-18 20:36 承续缘 阅读(284) 评论(0) 推荐(0) 编辑
摘要: 题目:Sort a linked list using insertion sort.代码:/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ... 阅读全文
posted @ 2015-05-18 20:00 承续缘 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 题目:Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.代码:/** * Definition for singly-linked list. * struc... 阅读全文
posted @ 2015-05-18 19:21 承续缘 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 题目:Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.代码:/**... 阅读全文
posted @ 2015-05-18 14:50 承续缘 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 题目:Given two sorted integer arraysnums1andnums2, mergenums2intonums1as one sorted array.Note:You may assume thatnums1has enough space (size that is gr... 阅读全文
posted @ 2015-05-18 14:40 承续缘 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-leaf path1->2->3which ... 阅读全文
posted @ 2015-05-18 11:23 承续缘 阅读(224) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below binary tree, 1 ... 阅读全文
posted @ 2015-05-18 10:29 承续缘 阅读(159) 评论(0) 推荐(0) 编辑

导航