- 博客(26)
- 收藏
- 关注
原创 leetcode 56. Merge Intervals 57. Insert Interval
56. Merge IntervalsGiven a collection of intervals, merge all overlapping intervals.For example,Given [1,3],[2,6],[8,10],[15,18],return [1,6],[8,10],[15,18].方法一:先按照start位置排序,然后挨个比较与身后的
2017-10-31 09:41:00 224
原创 leetcode 54|59. Spiral Matrix 1|2
54. Spiral MatrixGiven a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.For example,Given the following matrix:[ [ 1, 2, 3 ], [ 4, 5, 6 ]
2017-10-30 11:29:14 220
原创 leetcode 48. Rotate Image
You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Note:You have to rotate the image in-place, which means you have to modify the input 2D matrix d
2017-10-30 10:21:52 153
原创 leetcode 55|45. Jump Game 1|2
55. Jump GameGiven an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.
2017-10-30 10:05:51 173
原创 leetcode 42|407. Trapping Rain Water 1|2
Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.For example, Given [0,1,0,2,1,0,1,3,2,1,2,1],
2017-10-30 09:49:50 224
原创 leetcode 41|268. First Missing Positive 268. Missing Number
41. First Missing PositiveGiven an unsorted integer array, find the first missing positive integer.For example,Given [1,2,0] return 3,and [3,4,-1,1] return 2.Your algorithm should ru
2017-10-30 09:47:34 180
原创 leetcode 39|40|216|377. Combination Sum 1|2|3|4
39. Combination SumGiven a set of candidate numbers (C) (without duplicates) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.The same repeated numb
2017-10-30 09:33:46 203
原创 leetcode 35. 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 arra
2017-10-30 09:26:47 176
原创 leetcode 34. Search for a Range
Given an array of integers sorted in ascending order, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the order of O(log n).If the targ
2017-10-27 10:54:12 158
原创 leetcode 33|81. Search in Rotated Sorted Array 1|2
33. Search in Rotated Sorted ArraySuppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).You are given a t
2017-10-27 10:36:08 201
原创 leetcode 31. Next Permutation
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it as the lowest possib
2017-10-27 10:23:01 139
原创 leetcode 26|27|80. Remove Duplicates from Sorted Array 1|2 && 27.Remove Element
26. Remove Duplicates from Sorted Array Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for ano
2017-10-27 09:49:53 160
原创 leetcode 11. Container With Most Water
Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two
2017-10-23 16:32:14 163
原创 leetcode 287. Find the Duplicate Number
Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. Assume that there is only one duplicate number,
2017-10-23 16:13:29 160
原创 存储器层次结构
存储器层次结构存储器系统是一个层次结构,包括 CPU寄存器、高速缓存存储器、主存、磁盘。6.1存储技术随机访问存储器(RAM):一断电就没了,易失的静态RAM(SRAM):高速缓存动态RAM(DRAM):主存非易失性存储器:包括ROM,
2017-10-22 19:59:00 373
原创 leetcode 312. Burst Balloons
Given n balloons, indexed from0 to n-1. Each balloon is painted with a number on it represented by arraynums. You are asked to burst all the balloons. If the you burst ballooni you will get nums
2017-10-09 23:30:15 169
原创 leetcode 218. The Skyline Problem
A city's skyline is the outer contour of the silhouette formed by all the buildings in that city when viewed from a distance. Now suppose you are given the locations and height of all the buildings as...
2017-10-09 16:28:44 212
原创 leetcode 241. Different Ways to Add Parentheses
Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. The valid operators are +, - and *.Example 1In
2017-10-09 16:24:06 171
原创 leetcode 74|240. Search a 2D Matrix 1|II
74:Search a 2D MatrixWrite an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are sorted from left to right.The
2017-10-09 16:09:35 292
原创 leetcode 215. Kth Largest Element in an Array
Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.For example,Given [3,2,1,5,6,4] and k = 2, return 5.Note: Y...
2017-10-09 16:03:32 140
原创 leetcode 169|229. Majority Element 1|2
169. Majority ElementGiven an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that the array is non-empty and
2017-10-09 15:46:47 167
原创 leetccode 53. Maximum Subarray
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [-2,1,-3,4,-1,2,1,-5,4],the contiguous subarray [4,-1,2,1] ha
2017-10-09 15:44:56 146
原创 leetcode 4. Median of Two Sorted Arrays C++ Golang代码
There are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).Example 1:nums1 = [1, 3]nums2...
2017-10-09 15:35:24 170
原创 leetcode 21|23. Merge Two|k Sorted Lists
21. Merge Two Sorted ListsMerge 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./** * Definition for singly-link...
2017-10-09 15:26:18 178
原创 虚拟内存
小结:虚拟内存 VM:是硬件异常、硬件地址翻译、主存、磁盘文件和内核软件的完美交互。虚拟内存是对主存的一个抽象。支持虚拟内存的处理器通过使用一种叫做虚拟寻址的间接形式来引用主存。处理器产生一个虚拟地址,在呗发送到主存之前,会被翻译成一个物理地址,这个地址翻译需要硬件和软件结合。专门的硬件通过使用页表来翻译虚拟地址,而页表的内容是由操作系统提供的。
2017-10-09 09:58:57 513
原创 异常控制流
控制流 分为平滑的控制流(相邻的地址跳转) 和 跳转、调用、返回(控制流突变)突变控制流称为 异常控制流(ECF)异常异常就是控制流中状态的突变,处理器检测到事件发生时,会通过一张 异常表 的跳转表,间接调用异常处理程序。处理完之后,有三种可能性:1、将控制返回当前指令,即事件发生时正在执行的指令2、将控制返回给如果没有发
2017-10-04 10:32:44 257
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人