
算法--图、树
文章平均质量分 68
fssssssss
nju
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
找最低公共父节点
树的算法,用递归很方便,尽管复杂度可能较高。 using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Node { public Node left; public Node原创 2012-08-22 22:42:49 · 1133 阅读 · 1 评论 -
先序中序后序非递归遍历
#include #include #include using namespace std; class Node { public: Node(char data,Node *left,Node *right):data(data),left(left),right(right),flag(false){} char data; Node *left,*right;原创 2012-10-09 00:06:29 · 697 阅读 · 0 评论 -
Topological Sort
#include #include #include using namespace std; class Node { public: Node(string data) { this->data=data; begin=0; finish=0; color="white"; p=NULL; } string data; int begin; int finish原创 2014-11-16 14:25:28 · 615 阅读 · 0 评论