- 博客(6)
- 收藏
- 关注
原创 最大字段和算法
最大字段和算法: 这个算法在本学期的课程中,已经稍作了解。不过印象不够深刻。今天重新复习一下,加深理解。 最大字段和,无非就是三种情况: ①MAX在左半部分 ②MAX在右半部分 ③MAX在中间 ①②均可以使用递归来解决,情况三也并不是很复杂。先附上代码,然后逐条解释。 public class Solution { public int maxSubArray(int[] n
2017-07-31 21:43:40 1222
原创 VScode编辑器 ~常用快捷键
官方快捷键大全:https://code.visualstudio.com/docs/customization/keybindings Visual Studio Code是个牛逼的编辑器,启动非常快,完全可以用来代替其他文本文件编辑工具。又可以用来做开发,支持各种语言,相比其他IDE,轻量级完全可配置还集成Git感觉非常的适合前端开发。 所以我仔细研究了一下文档未来可能会
2017-07-31 20:05:30 1291
原创 Search Insert Position算法
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. You may assume no duplicates in the array.
2017-07-29 22:36:33 257
原创 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.
2017-07-26 21:34:45 707
原创 Remove Duplicates from Sorted Array
public class Solution { public int removeDuplicates(int[] nums) { if (nums == null || nums.length == 0) { return 0; } int last = 0; for (int i = 1; i <
2017-07-26 09:32:27 174
原创 Two Sum算法
①算法描述: Given nums = [2, 7, 11, 15], target = 9, Because nums[0] + nums[1] = 2 + 7 = 9, return [0, 1]. 解决方法: 一:使用java for循环,暴力搜索方式public int[] twoSum(int[] nums, int target) { for (int
2017-07-24 21:34:22 696 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人