排序
啦啦
STDEN
这个作者很懒,什么都没留下…
展开
-
首尾排序
FJ is about to take his N (1 ≤ N ≤ 2,000) cows to the annual"Farmer of the Year" competition. In this contest every farmer arranges his cows in a line and herds them past the judges.The contest organ...原创 2020-03-26 21:50:32 · 287 阅读 · 0 评论 -
拓扑排序
问题描述 小明的实验室有N台电脑,编号1~N。原本这N台电脑之间有N-1条数据链接相连,恰好构成一个树形网络。在树形网络上,任意两台电脑之间有唯一的路径相连。不过在最近一次维护网络时,管理员误操作使得某两台电脑之间增加了一条数据链接,于是网络中出现了环路。环路上的电脑由于两两之间不再是只有一条路径,使得这些电脑上的数据传输出现了BUG。为了恢复正常传输。小明需要找到所有在环路上的电脑,你能帮助他吗?输入格式第一行包含一个整数N。以下N行每行两个整数a和b,表示a和b之间有一条数据链接相连。对原创 2021-03-10 21:04:03 · 82 阅读 · 0 评论 -
归并排序
In this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjacent sequence elements until the sequence is sorted in ascending order. For the input sequence9 1 0 5 4 ,Ul原创 2021-01-24 14:23:50 · 266 阅读 · 0 评论