问题描述:超市有4种包装的鸡蛋,分别是3个一盒,6个一盒,9个一盒和20个一盒。问顾客要买N个鸡蛋时,所有的组合方案。(Morgen Stanley 2014
Intern).核心代码: 1 void BuyeggsCore(vector &coins, const int target, int ...
分类:
其他好文 时间:
2014-05-16 20:17:07
阅读次数:
289
第1章容器第1条:慎重选择容器类型。标准STL序列容器:vector、string、deque和list。标准STL关联容器:set、multiset、map和multimap。非标准序列容器slist和rope。slist是一个单向链表,rope本质上是一“重型”string。非标准的关联容器ha...
分类:
编程语言 时间:
2014-05-16 07:50:48
阅读次数:
390
色彩及图像基础(二)学习时间:2014.04.30学到了……1. 图形分为矢量图和位图。 2.
矢量图(vector - based image),是用一系列计算机指令来描述和记录一幅图,这幅图可分解为一系列子图如点、线、面等。 3.
位图(bit-mapped image),是用像素点来描述或映射...
分类:
其他好文 时间:
2014-05-16 06:54:25
阅读次数:
346
快速排序最坏情况下时间复杂度是O(n*n),但是它平均时间复杂度是O(N*logn),并且常数因子很小,可实现就地排序,所以被作为内排序的常用排序方法.
#include
using namespace std;
void swap(int &i,int &j)
{
int temp=i;
i=j;
j=temp;
}
int partition(int *vector...
分类:
其他好文 时间:
2014-05-15 06:05:35
阅读次数:
254
http://blog.sina.com.cn/s/blog_7c35df9b0100vtud.html
分类:
编程语言 时间:
2014-05-13 19:53:19
阅读次数:
255
简单总结下,我们从C++的内置数组讲到标准库提供的vector,
最后谈到C++11新增的array, 数组这个最基本的数据结构在C++中终于有了完整的支持。
分类:
其他好文 时间:
2014-05-13 18:04:29
阅读次数:
263
//升序void insertion_sort(vector &num){
for(int i = 1; i =0 && num[j] >= val){
num[j+1] = num[j];...
分类:
其他好文 时间:
2014-05-13 11:42:59
阅读次数:
190
/*
ID:kevin_s1
PROG:dualpal
LANG:C++
*/
#include
#include
#include
#include
#include
using namespace std;
int N,S;
vector result;
bool isPalindromic(string num){
bool flag = true;
int len =...
分类:
其他好文 时间:
2014-05-13 06:10:09
阅读次数:
312
集合基础知识数组:长度固定,可存基本数据和对象。集合:只能放对象,不固定。容器也有共性,不断抽取成一个体系,集合框架。参阅顶层创建底层。顶层是collection。collection里有两个常见的接口,List和Set。常见集合有Arraylist,linkedlist,vector,hashSetTreeSet.为什么..
分类:
其他好文 时间:
2014-05-13 03:35:07
阅读次数:
371