上一页 1 2 3 4 5 6 ··· 20 下一页
摘要: 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. 解题思路: Th 阅读全文
posted @ 2016-06-02 07:32 茜茜的技术空间 阅读(148) 评论(0) 推荐(0) 编辑
摘要: Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do this in-place without altering the nodes' values. For 阅读全文
posted @ 2016-06-02 07:02 茜茜的技术空间 阅读(426) 评论(0) 推荐(0) 编辑
摘要: Reverse a linked list from position m to n. Do it in-place and in one-pass. For example:Given 1->2->3->4->5->NULL, m = 2 and n = 4, return 1->4->3->2- 阅读全文
posted @ 2016-06-02 03:15 茜茜的技术空间 阅读(244) 评论(0) 推荐(0) 编辑
摘要: Reverse a singly linked list. Hint: A linked list can be reversed either iteratively or recursively. Could you implement both? A linked list can be re 阅读全文
posted @ 2016-06-02 02:41 茜茜的技术空间 阅读(385) 评论(0) 推荐(0) 编辑
摘要: Given arotatedsorted array, recover it to sorted array in-place.Example[4, 5, 1, 2, 3]->[1, 2, 3, 4, 5]ChallengeIn-place, O(1) extra space and O(n) ti... 阅读全文
posted @ 2016-01-19 10:01 茜茜的技术空间 阅读(294) 评论(0) 推荐(0) 编辑
摘要: There are two sorted arraysnums1andnums2of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should... 阅读全文
posted @ 2016-01-19 09:03 茜茜的技术空间 阅读(472) 评论(0) 推荐(0) 编辑
摘要: Merge two given sorted integer arrayAandBinto a new sorted integer array.ExampleA=[1,2,3,4]B=[2,4,5,6]return[1,2,2,3,4,4,5,6]ChallengeHow can you opti... 阅读全文
posted @ 2016-01-19 04:32 茜茜的技术空间 阅读(181) 评论(0) 推荐(0) 编辑
摘要: Follow up for "Remove Duplicates":What if duplicates are allowed at mosttwice?For example,Given sorted arraynums=[1,1,1,2,2,3],Your function should re... 阅读全文
posted @ 2016-01-19 03:16 茜茜的技术空间 阅读(301) 评论(0) 推荐(0) 编辑
摘要: Write an efficient algorithm that searches for a value in an m x n matrix, return the occurrence of it.This matrix has the following properties:Intege... 阅读全文
posted @ 2016-01-16 13:58 茜茜的技术空间 阅读(401) 评论(0) 推荐(0) 编辑
摘要: Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row are sorted in asc... 阅读全文
posted @ 2016-01-16 13:47 茜茜的技术空间 阅读(567) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 20 下一页