- 博客(6)
- 资源 (1)
- 收藏
- 关注
原创 LeetCode 88. Merge Sorted Array 归并的过程
Given two sorted integer arrays nums1 and nums2, merge nums2 intonums1 as one sorted array.题意:对于有序的两个数组nums1,nums2进行归并到nums1里保持其有序性1.按照归并排序进行归并的过程,需要单独开辟一块空间O(n),时间复杂度O(n)2.在进行归并的过程,需要注意越界
2017-03-14 19:48:37 481
原创 LeetCode 75. Sort Colors (三路快排)
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.Here, we will use the integers 0,
2017-03-14 16:45:50 560
原创 LeetCode 80. Remove Duplicates from Sorted Array II
Follow up for "Remove Duplicates":What if duplicates are allowed at most twice?For example,Given sorted array nums = [1,1,1,2,2,3],Your function should return length = 5, with the first five e
2017-03-14 11:23:16 300
原创 LeetCode 26 remove Duplicate from sorted array
Given a sorted array, remove the duplicates in place such that each element appear onlyonce and return the new length.Do not allocate extra space for another array, you must do this in place with
2017-03-12 17:12:36 318
原创 LeetCode 27. Remove Element
Given an array and a value, remove all instances of that value in place and return the new length.Do not allocate extra space for another array, you must do this in place with constant memory.The
2017-03-12 16:28:00 251
原创 LeetCode 283 move Zeroes
开始准备算法面试,毕竟马上找工作。将最近自己在leetcode做的题目记录一下,方便自己复习。同时也提供给有需要的朋友,https://leetcode.com/还没账号的朋友赶快去注册一个吧。内容将包括:自己第一遍做的想法和类比其他人的优化。优化主要是参考:慕课网一个实战课程:http://coding.imooc.com/class/82.html。感兴趣的可以看一下正文:28
2017-03-12 15:03:15 402
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人