
数据结构
小白B
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
/单向链表操作/ 节点对换 C++版
/单向链表操作/ 节点对换 C++版 创建node节点类ListNode,与链表类LinkList,属性均为public#include <iostream>using namespace std;#define ok 0#define error -1class ListNode {public: int data; ListNode *next; List原创 2016-09-20 21:19:03 · 338 阅读 · 0 评论 -
c++递归创建二叉树
建树的两种递归版本:1.无返回值版(较易理解)#include <iostream>#include <string>using namespace std;class BiTreeNode {public: BiTreeNode *LeftNode; BiTreeNode *RightNode; char data; BiTreeNode() :LeftNo原创 2016-10-28 20:34:48 · 2519 阅读 · 0 评论 -
DS图-最短路径
#include <iostream>#include <climits>using namespace std;const int MaxLen = 20;const int MaxDist = 9999;class Map {private: int Matrix[MaxLen][MaxLen]; int Vexnum;public: void SetMat原创 2016-11-18 15:37:05 · 1482 阅读 · 0 评论 -
C++最优路径之佛洛依德算法
#include<iostream>#include<cstring>#include<string>using namespace std;class Graph{private: int **matrix; int vexnum; string *name;public: Graph(string str[], int vnum){ ve原创 2016-12-15 00:00:07 · 1676 阅读 · 0 评论 -
图的邻接表存储表示
#include <iostream>using namespace std;#define MAX_VERTEXclass ArcNode {public: int adjvex; ArcNode *next; ArcNode() :next(NULL),adjvex(-1) {}};class VNode {public: char data;原创 2016-11-18 15:27:09 · 403 阅读 · 0 评论 -
拓补排序
//输入形式是邻接矩阵#include <iostream>#include <stack>using namespace std;class ArcNode {public: int adjvex; ArcNode *next; ArcNode() :next(NULL) {}};class VNode {public: char data;原创 2016-11-18 15:18:18 · 618 阅读 · 0 评论 -
C++二叉排序树之删除结点
#include <iostream>using namespace std;class TreeNode {public: int data; TreeNode *LeftChild; TreeNode *RightChild; TreeNode() :LeftChild(NULL), RightChild(NULL) {}};class BiSortTr原创 2016-11-30 23:32:21 · 741 阅读 · 0 评论 -
C++二叉排序树的创建和插入
加/**/表示另一种二叉排序树的创建方法第一类#include <iostream>using namespace std;class TreeNode {public: int data; TreeNode *LeftChild; TreeNode *RightChild; TreeNode() :LeftChild(NULL), RightChild(NUL原创 2016-11-30 22:49:11 · 2522 阅读 · 0 评论 -
C++二叉排序树之查找结点
#include <iostream>using namespace std;class TreeNode {public: int data; TreeNode *LeftChild; TreeNode *RightChild; TreeNode() :LeftChild(NULL), RightChild(NULL) {}};class BiSortTr原创 2016-11-30 23:21:17 · 505 阅读 · 0 评论 -
一元多项式相加与相乘(C++)
本人小白,如有错误恳请批评指正- <> -#include <iostream>using namespace std;#define OK 0#define ERROR -1class LNode {public: float data; int expn; LNode *next; LNode() { next = NULL; }原创 2016-10-07 16:03:49 · 1130 阅读 · 0 评论 -
C++迷宫
/*2016年10月10日19:48:47C++迷宫算法*/#include <iostream>#include <stack>using namespace std;void InitMaze(char **maze,int x,int y) { for (int i = 0; i < y+2; i++) maze[i] = new char[x+2];原创 2016-10-10 19:59:57 · 682 阅读 · 1 评论 -
单词拼写校正原理及实现(贝叶斯推断)
做网页检索系统的时候,当时还想加给它加上一个拼写纠错的功能(当然,只适合英文...),后来找到了个效果不错的方法给大家分享一下。拼写纠错、校正是一个提高搜索引擎用户体验的很关键的一项能力。如我们在Google搜索 saferi,然后会看到它自动帮助我们纠正了输错的单词。仔细想一想为什么它会知道我们输错的单词就是safari,我们会发现主要原因有两个;1. 错写的单词与正确单词...原创 2018-03-01 23:39:54 · 2718 阅读 · 0 评论