![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法--图、树
文章平均质量分 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 · 1013 阅读 · 1 评论 -
先序中序后序非递归遍历
#include#include#includeusing 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 · 656 阅读 · 0 评论 -
Topological Sort
#include#include#includeusing 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 · 582 阅读 · 0 评论