摘要: sort,用到了结构体第一种sort:282MS代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->#include<stdio.h>#include<algorithm>using namespace std;struct Array{ char data[30];}dna[20005];bool operator < (Array const& arr1, Array const& arr2) 阅读全文
posted @ 2010-04-22 22:21 SubmarineX 阅读(1998) 评论(0) 推荐(2) 编辑
摘要: 摘自刘汝佳的《算法竞赛入门经典》PreOrder(T) = T 的根结点 + PreOrder(T 的左子树) + PreOrder(T 的右子树);InOrder(T) = InOrder(T 的左子树) + T 的根结点 + InOrder(T 的右子树);PostOrder(T) = PostOrder(T 的左子树) + PostOrder(T 的右子树) + T 的根结点;输入一颗二叉树的先序遍历和中序遍历,输出它的后序遍历。Sample InputSample Output代码也可以省略build()函数的最后一个参数;代码 阅读全文
posted @ 2010-04-22 18:44 SubmarineX 阅读(244) 评论(0) 推荐(1) 编辑