自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(7)
  • 收藏
  • 关注

原创 lintcode第八题——旋转字符串

void rotateString(string &str, int offset) { // write your code here if (str.length() == offset || str.length() == 0) { return; } else if (str.l...

2019-08-08 18:24:21 173

原创 lintcode第七题——二叉树的序列化和反序列化

stringstream类知识点: <sstream>库定义了三种类:istringstream、ostringstream和stringstream,分别用来进行流的输入、输出和输入输出操作。  1.stringstream::str(); returns a string object with a copy of the current contents of the s...

2019-08-08 17:08:41 159

原创 lintcode第六题:合并排序数组

vector<int> mergeSortedArray(vector<int> &A, vector<int> &B) { // write your code here A.insert (A.end(),B.begin(),B.end()); sort(A.begin(),A.end(...

2019-07-13 17:36:26 150

原创 lintcode第5题:第K大元素

int kthLargestElement(int n, vector<int> &nums) { // write your code here int num = nums.size(); sort(nums.begin(), nums.end()); return nums[num-n]; }...

2019-07-13 16:46:52 234

原创 C++三个数组模板vector、数组、array

vector是一个动态sh数组,但付出的代价是效率比较低。vector<typeName> count(n_elem);size()——返回容器中元素的数目、begin()、end()。push_back( )将元素添加到矢量末尾。count.erase(count.begin(),count.begin()+ 2 );删除矢量中给定的区间的元素。count.insert(...

2019-07-13 16:01:48 207

原创 LintCode第四题:丑数

丑数的核心思想是:用已经生成的丑数chen乘2、3、5,求其最小值为新的丑数。int nthUglyNumber(int n) { // write your code here vector<int> count(1,1); int i2 = 0, i3 = 0, i5 = 0; while (count.size(...

2019-07-13 16:01:10 118

转载 c/c++常用开源库汇总

偶然发现的一个博客地址C/C++框架和库 (真的很强大):https://blog.csdn.net/xiaoxiaoyeyaya/article/details/42541419

2019-07-13 15:14:46 305

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除