
data structure
林志辉linzh
stay curious
展开
-
链表 实现多项式相加相乘polynomial
#include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */typedef struct poly_node * polynomial;struct poly_node{int coef;in转载 2016-12-04 15:00:22 · 457 阅读 · 0 评论 -
最短路径—Dijkstra算法和Floyd算法
注意:以下代码 只是描述思路,没有测试过!! Dijkstra算法1.定义概览Dijkstra(迪杰斯特拉)算法是典型的单源最短路径算法,用于计算一个节点到其他所有节点的最短路径。主要特点是以起始点为中心向外层层扩展,直到扩展到终点为止。Dijkstra算法是很有代表性的最短路径算法,在很多专业课程中都作为基本内容有详细的介绍,如数据结构,图论,运筹学等等。注意该算法要求图中不存在转载 2016-12-30 12:52:48 · 260 阅读 · 0 评论 -
二叉搜索树的操作
#include #include #include using namespace std;typedef struct treenode *ptrtonode;struct treenode{ int data; ptrtonode left; ptrtonode right;};ptrtonode buildtree(int num[], int n);ptrto原创 2017-04-07 21:07:50 · 276 阅读 · 0 评论