📄 gene.h
字号:
// Gene.h: interface for the Gene class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_GENE_H__4149CC78_4F9E_4906_9C7E_7E7D9E1B5141__INCLUDED_)
#define AFX_GENE_H__4149CC78_4F9E_4906_9C7E_7E7D9E1B5141__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <fstream.h>
#include <math.h>
//#define maxnode 34
//#define Dclength 23
typedef struct bnode
{
char data;
struct bnode *left;
struct bnode *middle;
struct bnode *right;
}btree;
class Gene
{
public:
Gene();
virtual ~Gene();
Gene(const char *,int &);; //初始化
void Insert();
void Postorder(const btree *);
void Result(const double *,const double *);
double & Displayresult();
int & Genejudge(const double *,const double *); //基因合法的判断
public:
void Ofdd(const btree *,ofstream &,const double *);
void Setbegin();
btree *headpoint; //头部指针
private:
int Dclength; //对应的尾部长度
char str[35];
char output[35]; //后序遍历的结果
int outlength;
//-------------------------------------------------------------------------------
btree head; //头部
btree node[33]; //结点不用指针的形式,可以防止内存的泄露
int nodepoint; //结点的指向
double aresult; //由基因求的值
//-------------------------------------------------------------------------------
int legal; //判断基因的合法性,legal=1合法
int begin; //YOut递归的参数 ofdd函数输出的参数
//------------------------------------------------------------------------
};
#endif // !defined(AFX_GENE_H__4149CC78_4F9E_4906_9C7E_7E7D9E1B5141__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -