- 博客(12)
- 收藏
- 关注
原创 leetcode——Search for a Range 二分查找重复数字
Given a sorted array of integers, 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 target is not found
2016-10-20 13:39:06
562
原创 leetcode——Search Insert Position 二分查找 binary search
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.
2016-10-20 10:00:49
337
原创 leetcode——backtracking and array 递归类问题
Combination Sum: Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. The same repeated number may be chosen
2016-10-19 09:38:25
293
转载 c++标准库——容器类
容器类可以分为两大类和容器适配器: (1)序列容器(Sequence containers) 这种容器中的元素是有序的,每一个元素在容器中都有一个确切的位置,这个位置不依赖于元素的值,而是跟放入容器的时机有关。标准的序列容器有三个:vector, deque, list。另外你也可以把字符串(string)和数组(array)看成序列容器。 Vectors 一个vector
2016-09-12 16:00:14
1292
转载 leetcode--merge two sorted lists
原题目连接: https://leetcode.com/problems/merge-two-sorted-lists/ Merge 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
2016-09-05 15:26:58
229
转载 leetecode——add two numbers
原题目连接 https://leetcode.com/problems/add-two-numbers/ You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain
2016-09-01 11:03:18
354
转载 leetcode--sum of two integers
原题目网址 https://leetcode.com/problems/sum-of-two-integers/ Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -. Example: Given a = 1 and b = 2, ret
2016-08-31 15:27:56
171
原创 hackerrank----Flatland Space Stations
原题目网址: https://www.hackerrank.com/challenges/flatland-space-stations Flatland is a country with cities, of which have space stations. Its cities () are numbered from to , where city is referred
2016-08-30 09:59:39
722
原创 hackerrank笔记——lisa's workbook
题目链接:Lisa's Workbook Lisa just got a new math workbook. A workbook contains exercise problems, grouped into chapters. There are chapters in Lisa's workbook, numbered from to . The -th
2016-08-15 15:11:10
300
原创 c++顺序容器
一 顺序容器类型: deque 双端队列,头尾位置插入删除#include deque list 双向链表,在任何位置进行插入删除#include list array 固定大小数组,随机访问不可添加删除,与内置数组不同#include vector string 二 容器的操作 容器类型成员 vector::iterator it v
2016-08-11 19:37:34
154
原创 c++标准库类型——vector
一 标准库类型vector表示对象的集合,对象类型相同,需要: #include using namespace std; or using std::vector; 二 定义和初始化vector对象 vector v1; vector v2(v1); vector v2=v1; vector v3(n,val); \\n个val元素 vector v4(n);\\n个
2016-08-11 15:06:20
296
原创 c++_标准库类型string
一 标准库类型 string 是可变长的字符序列,使用string类型需要: #include using namespace std; or using std::string; 二 定义与初始化 直接初始化 拷贝初始化 string s1;
2016-08-11 11:01:48
230
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人