上一页 1 2 3 4 5 6 7 8 ··· 14 下一页
摘要: Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. Return the maximum pro 阅读全文
posted @ 2016-04-27 14:50 lilixu 阅读(125) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom. For exa 阅读全文
posted @ 2016-04-14 15:23 lilixu 阅读(121) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL 阅读全文
posted @ 2016-04-14 15:03 lilixu 阅读(154) 评论(0) 推荐(0) 编辑
摘要: Sort a linked list using insertion sort. 以第一个元素head后面接null为起始数组,然后后面每个node插入排序,然而超时。 评论区的优化:双指针在原链表上插入排序,且只有在该node需要被插入开始处重置开始指针。 阅读全文
posted @ 2016-04-07 18:00 lilixu 阅读(131) 评论(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 @ 2016-04-07 11:35 lilixu 阅读(107) 评论(0) 推荐(0) 编辑
摘要: Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the 阅读全文
posted @ 2016-04-06 17:11 lilixu 阅读(122) 评论(0) 推荐(0) 编辑
摘要: Given an unsorted array of integers, find the length of longest increasing subsequence. For example,Given [10, 9, 2, 5, 3, 7, 101, 18],The longest inc 阅读全文
posted @ 2016-03-28 17:44 lilixu 阅读(188) 评论(0) 推荐(0) 编辑
摘要: Compare two version numbersversion1andversion2.Ifversion1>version2return 1, ifversion1 len(x2): for i in range(len(x1)-len(x2)): ... 阅读全文
posted @ 2015-07-19 16:46 lilixu 阅读(152) 评论(0) 推荐(0) 编辑
摘要: Given an arraynums, there is a sliding window of sizekwhich is moving from the very left of the array to the very right. You can only see theknumbers ... 阅读全文
posted @ 2015-07-18 17:00 lilixu 阅读(179) 评论(0) 推荐(0) 编辑
摘要: Given an array ofnintegers wheren> 1,nums, return an arrayoutputsuch thatoutput[i]is equal to the product of all the elements ofnumsexceptnums[i].Solv... 阅读全文
posted @ 2015-07-18 15:20 lilixu 阅读(150) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 14 下一页