造轮子
_Neha
这个作者很懒,什么都没留下…
展开
-
线索二叉树实现
#include<iostream>using namespace std;#define MAX 10typedef int ElemType;typedef int status;typedef struct Ptree { ElemType data; struct Ptree* lchild, * rchild; int ltool,rtool;}Ptree;typedef struct Ptree* tree;tree pr = NULL; /.原创 2021-10-21 09:29:56 · 109 阅读 · 0 评论 -
4.4 栈 顺序存储结构(大话)c++实现 21.10.12
#include<stdio.h>#include <iostream>#include< stdlib.h>using namespace std;#define MAX 20#define OK 1#define NO 0typedef int ElemType;/*数组储存类型*/typedef int Status; /*函数返回值*/typedef struct Stack { ElemType num[MAX]; int .原创 2021-10-12 00:03:59 · 120 阅读 · 0 评论 -
3.6 链式存储结构(大话)c++实现 21.10.08
#include "stdio.h" #include "string.h"#include "ctype.h" #include "stdlib.h" #include"iostream"#include"typeinfo"#include "math.h" #include "time.h"using namespace std;#define OK 1#define ERROR 0#define TRUE 1#define FALSE 0#defin.原创 2021-10-08 23:05:13 · 159 阅读 · 0 评论 -
贪婪算法 python实现(未注释) 21.10.3
states_needed = set( ["mt", "wa", "or", "id", "nv", "ut", "ca", "az"] )stations = { }stations["kone"] = set( ["id", "nv", "ut"] )stations["ktwo"] = set( ["wa", "id", "mt"] )stations["kthree"] = set( ["or", "nv", "ca"] )stations["kfour"] = set( ["nv".原创 2021-10-03 22:53:38 · 112 阅读 · 0 评论 -
简单BFS算法 python实现(未注释)21.10.1
def seller(people): if people=='刘庄村': return 1 return 0def Search(search): i=0 searched=[] while(search): people = search.popleft( ) if people not in searched: #print(people) if sell.原创 2021-10-03 09:53:14 · 156 阅读 · 0 评论 -
简单BFS算法 C++实现(未注释) 21.10.1
int main(){ queue<int> search; int group[3][3] = {1,3,5,7,9,11,13,15,17}; for (int i = 0; i < 3; i++) { search.push(group[0][i]); } int research(queue<int> search,int group[][3]); research(search, group...原创 2021-10-03 09:51:04 · 313 阅读 · 0 评论 -
狄克斯特拉算法 python实现(未注释)21.10.3
def Search_low(name): #cost为到该点的总价格 #cost=costs[name] #把要查的节点name的邻居全拿出来 newcost=[] for son in graph[name]: #newcost=哈希表中相邻的价格 if (son not in used) and (son not in faused): newcost.append(graph[name][son]).原创 2021-10-03 09:48:55 · 103 阅读 · 0 评论