vector
_xiaoyuer
世界一定有光
展开
-
LeetCode - 542 - 01 Matrix
Given a matrix consists of 0 and 1, find the distance of the nearest 0 for each cell.The distance between two adjacent cells is 1.Example 1: Input:0 0 00 1 00 0 0Output:0 0 00 1 00原创 2017-04-17 20:23:17 · 241 阅读 · 0 评论 -
LeetCode - 436 - Find Right Interval
Given a set of intervals, for each of the interval i, check if there exists an interval j whose start point is bigger than or equal to the end point of the interval i, which can be called that j is on原创 2017-04-16 16:15:03 · 207 阅读 · 0 评论 -
LeetCode - 435 - Non-overlapping Intervals
Given a collection of intervals, find the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping.Note:You may assume the interval's end point is alw原创 2017-04-16 16:31:58 · 215 阅读 · 0 评论 -
LeetCode - 56 - Merge Intervals
Given 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].Subscribe to see which companies asked this qu原创 2017-04-16 16:41:49 · 162 阅读 · 0 评论 -
STL学习笔记-vector
Vector笔记push_back()新增元素时,如果超过原有的容量,则容量(capacity())会扩充至两倍insert()插入元素时,计算插入后长度,若插入后长度小于容量,则直接后移指针;若插入后大于容量,则将容量扩大为size()的两倍,若容量还是不足,就会扩大至足够大的容量。(容量的扩张必经【重新配置、元素搬移、释放原空间】等过程)。#include #incl原创 2017-07-17 15:43:53 · 209 阅读 · 0 评论