- 博客(11)
- 资源 (10)
- 收藏
- 关注
原创 lintcode:Partition Array
Given an array nums of integers and an int k, partition the array (i.e move the elements in “nums”) such that:All elements < k are moved to the left All elements >= k are moved to the right Return th
2015-10-28 17:17:29 927
原创 lintcode:2sum
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 numbers such that they add up to the target, where in
2015-10-27 15:15:50 492
原创 lintcode:3 Sum
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Example For example, given array S = {-1 0 1
2015-10-26 22:14:34 413
转载 为什么static成员必须在类外初始化
为什么静态成员不能在类内初始化在C++中,类的静态成员(static member)必须在类内声明,在类外初始化,像下面这样。class A{ private: static int count ; // 类内声明};int A::count = 0 ; // 类外初始化,不必再加static关键字为什么?因为静态成员属于整个类,而不属于某个对象,如果在类内初始化,会导致每个对象都包
2015-10-25 22:41:56 3236
原创 lintcode:3 Sum Closest
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers.Example For example, given array S = {-1 2 1 -4},
2015-10-25 22:05:07 747
原创 lintcode:Merge Sorted Array
Given two sorted integer arrays A and B, merge B into A as one sorted array.Example A = [1, 2, 3, empty, empty], B = [4, 5]After merge, A will be filled as [1, 2, 3, 4, 5]Note You may assume that A h
2015-10-14 20:55:30 477
原创 lintcode:Product of Array Exclude Itself
Given an integers array A.Define B[i] = A[0] * … * A[i-1] * A[i+1] * … * A[n-1], calculate B WITHOUT divide operation.Example For A = [1, 2, 3], return [6, 3, 2].1.提交1class Solution {public: /**
2015-10-14 20:49:55 684
转载 2014找工作总结-机会往往留给有准备的人
http://blog.csdn.net/xiajun07061225/article/details/12844801
2015-10-14 15:23:09 495
转载 对象创建:Java和C++比较
1、C++创建对象方式在C++中我们可以采用如下两种方式来创建对象,Dog dog;//Dog为类名 Dog *p = new Dog();这两种方式在C++中都能完成对象的创建,但是在内存中的处理却完全不同。对于第一种方式而言,dog是被存储在栈中的,占用的大小是Dog类中成员变量占用内存的和,此处不包括成员方法,因为成员方法是存放在公共存储区以便所有该类的对象都可以访问的。对于第二种方式则
2015-10-10 09:48:10 433
原创 Lintcode 比较字符串
比较两个字符串A和B,确定A中是否包含B中所有的字符。字符串A和B中的字符都是 大写字母样例给出 A = "ABCD" B = "ACD",返回 true给出 A = "ABCD" B = "AABC", 返回 false注意在 A 中出现的 B 字符串里的字符不需要连续或者有序。class Solution {public: /** *
2015-10-07 20:52:52 1533
Win7平台VS2010安装Visual Assist X
2015-03-20
合工大操作系统课程设计:基于内存的文件系统
2013-07-07
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人