该文被密码保护。
12 2012 档案
摘要:View Code #include<iostream>using namespace std;int n;float c;float bestv=0;float backknap(float w[],float v[],int bestx[],int x[],float sw,float sv,int t){ int j; float r; //剩余物品的总价值 if(t>=n){ if(sv>bestv){ //如果解比当前解更优 bestv=sv; fo...
阅读全文
摘要:以下是C++类模版,存起来,以后想用,修改下就OKView Code template<class T>struct Node{ T data; //数据域,存放表元素 Node *next; //指针域,指向下一个节点};template<class T>class LinkList{private: Node<T>*Head;public: LinkList(); //构造函数 ~LinkList(); ...
阅读全文
摘要:View Code #ifndef QUEUE_H#define QUEUE_H#include <cassert>//类模版的定义template<class T,int SIZE=50> //size是队列能容纳的个数class Queue{private: int front,rear,count; //队头指针,队尾指针,元素个数 T list[SIZE]; //队列的元素数组public: Queue(); //构造函数,初始化队头...
阅读全文

浙公网安备 33010602011771号