摘要: 静态:static用法:是一个修饰符;用于修饰成员(成员变量和成员函数)当成员被静态修饰后,就多了一种调用方式,除了可以被对象调用外,还可以直接被类名调用格式:类名.静态成员静态的特点:1.随着类的加载而加载也就是,说静态会随着类的消失而消失,说明静态的生命周期最长2.优先于对象的存在明确一点:静态... 阅读全文
posted @ 2015-04-09 11:29 ~每天进步一点点~ 阅读(190) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two nu... 阅读全文
posted @ 2015-04-06 22:09 ~每天进步一点点~ 阅读(119) 评论(0) 推荐(0) 编辑
摘要: Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where "adjace... 阅读全文
posted @ 2015-04-06 20:04 ~每天进步一点点~ 阅读(517) 评论(0) 推荐(0) 编辑
摘要: void temp(int *l,int i,int j){ int t=l[i]; l[i]=l[j]; l[j]=t; }int partition(int *l,int low,int high){ int privotkey=l[low]; whi... 阅读全文
posted @ 2015-04-05 22:40 ~每天进步一点点~ 阅读(152) 评论(0) 推荐(0) 编辑
摘要: #include "stdafx.h"void temp(int *l,int i,int j){ l[i]=l[i]^l[j]; l[j]=l[i]^l[j]; l[i]=l[i]^l[j];}//使用异或有个问题,当i和j相等时,不能实现交换的目的void HeapSort_M... 阅读全文
posted @ 2015-04-05 22:39 ~每天进步一点点~ 阅读(120) 评论(0) 推荐(0) 编辑
摘要: N个人围一圈报数,数到3 退出,最后一个是几号(1)自定义链表typedef struct Node{ int value; struct Node* next;}Node ,*Link;Link creat(int n){ Link node=new Node; node-... 阅读全文
posted @ 2015-04-05 22:34 ~每天进步一点点~ 阅读(190) 评论(0) 推荐(0) 编辑
摘要: Sort a linked list inO(nlogn) time using constant space complexity./** * Definition for singly-linked list. * struct ListNode { * int val; * L... 阅读全文
posted @ 2015-04-05 22:23 ~每天进步一点点~ 阅读(170) 评论(0) 推荐(0) 编辑
摘要: Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.class Solution {public: ... 阅读全文
posted @ 2015-04-05 21:13 ~每天进步一点点~ 阅读(130) 评论(0) 推荐(0) 编辑
摘要: Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Pana... 阅读全文
posted @ 2015-04-05 16:57 ~每天进步一点点~ 阅读(87) 评论(0) 推荐(0) 编辑
摘要: Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a challenge, please do not see below and ... 阅读全文
posted @ 2015-04-05 15:15 ~每天进步一点点~ 阅读(133) 评论(0) 推荐(0) 编辑