问题描述:层遍历二叉树,同一层从左往右打印。定义二元查找树的结点为:typedef struct BSTreeNode { int data; BSTreeNode *left; BSTreeNode *right;} Node;例如输入二叉树:6/ \4 12/ \ / \25...
分类:
其他好文 时间:
2014-08-11 14:40:32
阅读次数:
173
基本小圆覆盖模板题#include #include #include using namespace std;int X,Y; int n;const double eps=0.00000001;struct point{ double x,y;}p[550]; struct Circle{...
分类:
其他好文 时间:
2014-08-11 14:25:02
阅读次数:
228
#include "iostream.h"
#define MAXSIZE 10
typedef struct queue{
int q[MAXSIZE] ;
int front;
int rear;
int n;//用于引用计数
};
void initQueue(queue* qq);
void initQueue(queue* qq) //此处必须是引用...
分类:
编程语言 时间:
2014-08-11 12:02:52
阅读次数:
259
import osimport sysimport structdef enc(path, key): path_ret = "" for i in range(0, len(path)/4): path_ret += struct.pack(">> ===========...
分类:
编程语言 时间:
2014-08-11 11:27:22
阅读次数:
2362
题意:判断是否成环。
策略:如题。
这道题就是简单的拓扑排序题,但是要注意一点要去重复的数据。我用了两种结构体:链式前向星和邻接矩阵。
代码1:(用链式前向星)(不用增加去重)
#include
#include
#include
#define INF 0x3f3f3f3f
#define MAXN 105
struct EdgeNode{
int to;
int next;
}ed...
分类:
其他好文 时间:
2014-08-11 10:08:52
阅读次数:
244
1、用sort对结构体中字符串进行二级排序
#include
#include
using namespace std;
struct s
{
int d;
char c[10];
}ss[15];
bool cmp(s a,s b)
{
if(strcmp(a.c,b.c)!=0)
...
分类:
其他好文 时间:
2014-08-11 06:19:01
阅读次数:
171
结构体初学者都有点小怕其实思维清晰之后你会发现结构体是个非常好的东西,嘿嘿。第一,结构体的定义和初始化。别被书上大量的描述吓到1.怎么定义结构体了例子如下,我们以构建一个包含学生姓名,年龄,Email为例子1 struct 2 {3 char name;4 int age;5 ...
分类:
其他好文 时间:
2014-08-11 00:16:51
阅读次数:
215
问题描述:输入一颗二元查找树,将该树转换为它的镜像树,即对每一个节点,互换左右子树。例如输入: 6/ \4 12/ \ / \25 816输出: 6/ \12 4/ \ / \16852定义二元查找树的结点为:typedef struct BSTree { int dat...
分类:
其他好文 时间:
2014-08-10 23:48:50
阅读次数:
316
通讯录中的一条记录包含下述基本信息:朋友的姓名、出生日期、性别、固定电话号码、移动电话号码。 本题要求编写程序,录入N条记录,并且根据要求显示任意某条记录。输入格式:输入在第1行给出正整数N( 2 #include 3 4 struct tong{ 5 char name[11]; 6 ...
分类:
其他好文 时间:
2014-08-10 21:25:10
阅读次数:
230
1.Echo网络库的编写 1.1 Echo网络库1.0 1.1.1 Echo网络库 1.0 框架分析 a)class InetAddress: 主要用来定义一个struct sockaddr_in 结构(用自定义端口号初始化),并提供获取这个结构体成员如IP、Port等的接口; ...
分类:
系统相关 时间:
2014-08-10 21:24:01
阅读次数:
421