自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(8)
  • 资源 (3)
  • 收藏
  • 关注

原创 C++动态数组

1. 变长一维数组cin>>len;int* array=new int[len];       //用指针array指向new动态分配的长度为len*sizeof(int)的内存空间 delete[] array;注意int array[len]; 会报错,因为用这种形式声明数组,数组的大小需要在编译时确定。int[]  array=new int[len]; 也

2016-07-20 23:12:19 411

原创 非递归求解斐波那契数列

题目:Climbing StairsYou are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?

2016-07-10 23:36:06 444

原创 全排列(含有重复元素)

题目:Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2] have the following unique permutations:[1,1,2], [1,2,1], a

2016-05-30 22:19:04 776

原创 Plus one

1.vector digits向最前面添加元素 :int add=2;digits.insert(digits.begin(),add);2.删除尾元素  digits.pop_back();

2016-05-30 19:34:47 206

原创 删除数组中给定的元素

题目: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 memo

2016-05-16 09:27:37 301

原创 链表归并排序

思路: 就是遍历两个链表,每次取最小值,temp指向该值。ListNode* mergeTwoLists(ListNode* l1, ListNode* l2) {ListNode* temp=new ListNode(0);ListNode* head=temp;while(l1 && l2){if(l1->valval){temp->next=l1;l1=l

2016-05-12 15:22:25 211

原创 Longest Common Prefix

string longestCommonPrefix(vector& strs) {        int n=strs.size();        if(n==0)            return "";        if(n==1)            return strs[0];        int i=-1;        while(strs[0

2016-05-10 22:33:48 188

原创 判断回文串--递归实现

题目:  递归实现,判断给定字符串是否是回文串。思路: 首先判断给定字符串首位字符是否相等,若相等,则判断去掉首尾字符后的字符串是否为回文,若不相等,则该字符串不是回文串。代码:bool isReverseSame(const char* str ,int  strlen){    if(strlen==0 || strlen==1)return true;   r

2016-05-06 21:56:34 1535

普适计算技术

本文档描述了普适计算与移动计算的相关技术和最新应用,适合初学者。

2015-11-10

另解析java编程精髓

另解析java编程精髓

2014-09-13

关于Java开发的浅析

java开发的浅析。我的一点小小一一意见

2014-09-13

空空如也

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

TA关注的人

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