上一页 1 ··· 42 43 44 45 46 47 48 49 50 ··· 92 下一页
http://www.cs.rpi.edu/~hollingd/psics/notes/backtracking.pdfTwo situations:– Finding a solution to a problem can't be based on astraight path to the goal.● consider traversing a maze.– We need a better approach than brute force(independently evaluating all possible solutions).● Think of the TSP Read More
posted @ 2011-10-13 19:51 庚武 Views(1286) Comments(0) Diggs(0)
//Singleton.cpp 默认构造函数#include <iostream>using namespace std;class Singleton{public: static Singleton* Instance();private: Singleton(){} static Singleton * _instance;};Singleton* Singleton::_instance=0;Singleton* Singleton::Instance(){ if(_instance==0){ _instance = new Singleton()... Read More
posted @ 2011-10-11 10:43 庚武 Views(200) Comments(0) Diggs(0)
#include <stdio.h>#include <stdlib.h>typedef int KeyType;struct ElemType{ int key;};int find_seq(struct ElemType arr[],int n,KeyType key){ int i=0; for(;i<n;i++){ if(arr[i].key==key)return i; printf("check %d\n",arr[i]); } return -1;}//较好的提高,for循环里只有一个判断,注意数据不能越界int find... Read More
posted @ 2011-10-10 21:08 庚武 Views(285) Comments(0) Diggs(0)
转载自 http://xuliduo.iteye.com/blog/639923dos命令:chcp 65001 就是换成UTF-8代码页 chcp 936 可以换回默认的GBK chcp 437 是美国英语 Read More
posted @ 2011-10-07 02:11 庚武 Views(2155) Comments(0) Diggs(0)
Note that only command events (whose event classes are based directly or indirectly on wxCommandEvent) are recursively applied to the window parent's event handler. As this quite often causes confusion for users,here is a list of system events that will not get sent to the parent's event han Read More
posted @ 2011-10-06 19:00 庚武 Views(350) Comments(0) Diggs(0)
Ultimate Packer for eXecutables Copyright (C) 1996 - 2010UPX 3.07w Markus Oberhumer, Laszlo Molnar & John Reiser Sep 08th 2010Usage: upx [-123456789dlthVL] [-qvfk] [-o file] file..Commands: -1 compress faster -9 compre... Read More
posted @ 2011-10-06 16:00 庚武 Views(565) Comments(0) Diggs(0)
windows下,注意文件格式设为UTF-8。Code::Blocks 10.05设置: Setting -> EditorMain.cpp:#include "wx/wx.h"//Declare the application classclass MyApp:public wxApp{public: //Called on application startup virtual bool OnInit();};// Declare our main frameclassclass MyFrame:public wxFrame{public: // Construc Read More
posted @ 2011-10-05 00:26 庚武 Views(1097) Comments(0) Diggs(0)
复制构造函数copy constructor、赋值操作符 operator =、析构函数destructor:不管类是否定义了自己的析构函数,编译器都自动执行类中非static数据成员的析构函数。复制构造函数、赋值操作符、析构函数 总称为复制控制(copy control)。编译器自动实现这些操作,但类也可以定义自己的版本。下面代码所使用copy contructor的地方有:class Point{public: Point(){} Point(const Point & p){ static int i=0; cout<<++i<<"call Po Read More
posted @ 2011-10-03 11:50 庚武 Views(291) Comments(0) Diggs(0)
WxWindowsQuickRef快速引用:http://wiki.codeblocks.org/index.php?title=WxWindowsQuickRef#Frequently_Asked_Questions中文wxWidgets编译与简单测试http://hi.baidu.com/fcl06/blog/item/5233d8efbdaa763fadafd52f.html-------------------------------------------------------Execute the build command. The recommended command to Read More
posted @ 2011-10-03 00:35 庚武 Views(1058) Comments(0) Diggs(0)
map<char,int> first; first['a']=1; first['b']=2; first['c']=3; first['d']=4; first['e']=5; first['a']=11; //overrite 1 map<char,int>::iterator it; for(it=first.begin();it!=first.end();++it){ cout<<it->first<<"="< Read More
posted @ 2011-10-02 21:22 庚武 Views(276) Comments(0) Diggs(0)
上一页 1 ··· 42 43 44 45 46 47 48 49 50 ··· 92 下一页