随笔分类 - 图论
摘要:The Tourist Guide Mr. G. works as a tourist guide. His current assignment is to take some tourists from one city to another. Some two-way roads connec
阅读全文
摘要:Each year, fall in the North Central region is accompanied by the brilliant colors of the leaves on the trees, followed quickly by the falling leaves
阅读全文
摘要:前序的第一个是整个树的根 后序的最后一个是整个树的根 中序用来判别左右子树的划分 前序序列中左子树部分的第一个节点是左子树的根节点 前序序列中右子树部分的第一个节点是右子树的根节点 前序序列的特点可知树根后面紧接着的应当是左子树的树根 二叉树的先序、中序、后序遍历序列 https://blog.cs
阅读全文
摘要:Little Valentine liked playing with binary trees very much. Her favorite game was constructing randomly looking binary trees with capital letters in t
阅读全文
摘要:BIT has recently taken delivery of their new supercomputer, a 32 processor Apollo Odyssey distributed shared memory machine with a hierarchical commun
阅读全文
摘要:题意比较难懂,难点也在于转换题意 题意:找a-b所有路径中最大步数里面最小的 本来先用最小生成树写的,但是没写出来: #include<iostream> #include<string.h> #include<cmath> #include<iomanip> #define inf 0x3f3f3
阅读全文
摘要:今天写了这一题,一开始跑了两个Dijkstra,但是造成内存超限,所以现在在学习邻接表,打算明天用邻接表和优先队列写,目前还在学习中,所以题目啥也还没上传,先上传了今晚对于邻接表的理解(见上图),明天把这个解决了,再放上两个一个超时一个不超时的代码
阅读全文
摘要:##题意 第一行一个5,代表1-5五个元素,每一行以0结束说明该行输入结束,往下走,第一行代表1的儿子没有,第二行代表2的儿子是4、5、1,第三行代表3的儿子是1,第四行代表4的儿子是5、3,第五行代表5的儿子是3;从长辈到晚辈依次输出。 ##思路 拓扑排序模板题。这一题英文看不懂,翻译了发现我,,
阅读全文
摘要:上周花了一周多的时间看了最小生成树,最短路,并查集这一块内容,这是上周新学的知识点,时间拉的确实有点长,尤其是1875那一题卡了很久,用两种方法写比较混乱,虽然也是花了一周多的时间,但是也只会写写这些模板题,而且对于这些容易把代码掺杂在一起写,思路逻辑不清,这一点需要自己多去找找原因,理清思路。 #
阅读全文