点击打开链接
求MST的最长边~
prim
#include
#include
#include
#include
#define Min(a,b) (a)<(b)?(a):(b)
using namespace std;
const int INF = 1000000000;
const int maxn = 2000 + 5;
struct pto
{...
分类:
其他好文 时间:
2014-06-11 06:45:17
阅读次数:
235
1 #ifndef __MAPLE_MATRIX_H__ 2 #define
__MAPLE_MATRIX_H__ 3 4 #include "maple.h" 5 6 typedef struct MATRIX{ 7 union{ 8
...
分类:
其他好文 时间:
2014-06-10 16:04:42
阅读次数:
159
按先序遍历创建一棵树,以层次遍历输出
样例输入
A B # D # # C E # # F # #
样例输出
LevelOrder: A B C D E F
代码:
#include
#include
using namespace std;
struct node { //表示一个树上的节点
char ch;
nod...
分类:
其他好文 时间:
2014-06-10 15:58:02
阅读次数:
295
Sort a linked list using insertion sort. 1 /**
2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 *
ListNode *nex...
分类:
其他好文 时间:
2014-06-10 12:14:19
阅读次数:
253
1 #ifndef __MAPLE_MATRIX_H__ 2 #define
__MAPLE_MATRIX_H__ 3 4 #include "maple.h" 5 6 typedef struct MATRIX{ 7 union{ 8
...
分类:
其他好文 时间:
2014-06-10 10:28:48
阅读次数:
310
//Callback.h#ifndef __CALLBACK_H__#define
__CALLBACK_H__typedef void (*T_CallBack)(void *);typedef struct { T_CallBack cb;
void *obj;}ST_CallBa...
分类:
编程语言 时间:
2014-06-10 10:26:44
阅读次数:
298
题意:求在可以一秒沿着既定方向走1到3步和向左或右转90度的情况下,从起点到终点的最短时间
思路:坑的是这机器人还有体积,所以不能走到边界,然后就是单纯的BFS
#include
#include
#include
#include
#include
using namespace std;
const int MAXN = 110;
struct node {
int x,y;...
分类:
其他好文 时间:
2014-06-10 07:59:51
阅读次数:
256
二叉链表的C语言描述基本运算的算法——建立二叉链表、先序遍历二叉树、中序遍历二叉树、后序遍历二叉树、后序遍历求二叉树深度#include#includeusing
namespace std;class Tree{private: struct Node { char da...
分类:
其他好文 时间:
2014-06-09 18:39:49
阅读次数:
310
#include using namespace std;struct Node{ Node
*next; int elem;};void creatList(Node* &head){ head = new Node; int elem;
cin>>elem; ...
分类:
其他好文 时间:
2014-06-09 17:50:43
阅读次数:
219