自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(4)
  • 收藏
  • 关注

原创 重构二叉树(根据前序和中序)

题目来源:http://cie.xtu.edu.cn/exam/index.php/problem/exam_read/id/1046/exam_id/33题目大意:给出一个二叉树的前序和中序遍历,重构二叉树,然后查找指定结点的孩子结点,参考了网上的算法。// 重构二叉树.cpp : 定义控制台应用程序的入口点。#include "stdafx.h"#include "iostream

2011-12-06 17:05:16 345

原创 二叉排序树的创建和查找

//head2.h#include #include using namespace std;templateclass BinarySortTree{private: typedef struct BinaryNode { type data; BinaryNode* left; BinaryNode* right; BinaryNode(type dt,Bin

2011-12-06 16:55:33 438

原创 Kruskal+并查集:John的农场

研究了半天,利用Kruskal结合并查集搞定了最小生成树,代码感觉还是很清晰的。//John的农场(最小生成树).cpp : 定义控制台应用程序的入口点。#include "stdafx.h"#include #include #include using namespace std;struct Node{ int v1,v2; int weight;

2011-12-03 18:50:29 1547

原创 DFS做小希的迷宫(图论)

第一次学习写DFS,什么都不会,只能写出这些东西,大牛见了还请批评指正!// 小希的迷宫.cpp : 定义控制台应用程序的入口点。#include "stdafx.h"#include #include using namespace std;struct Edge//用结构体存储边信息,flag表示该边是否被选取。{ int v1,v2; int flag;

2011-12-02 16:59:33 335

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除