摘要: 来源:https://leetcode.com/problems/sort-colors Given an array with n objects colored red, white or blue, sort them so that objects of the same color are 阅读全文
posted @ 2017-09-19 21:24 HitAnyKey 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 来源:https://leetcode.com/problems/insertion-sort-list Sort a linked list using insertion sort. 方法: 1. 使用一个preHead指向头节点,这样在将节点插入头节点前面时(即某个节点值比头节点小)不需要进行 阅读全文
posted @ 2017-09-19 20:49 HitAnyKey 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 来源:https://leetcode.com/problems/intersection-of-two-arrays Given two arrays, write a function to compute their intersection. Example:Given nums1 = [1 阅读全文
posted @ 2017-09-19 10:35 HitAnyKey 阅读(172) 评论(0) 推荐(0) 编辑