-
关于猎人过河问题 要解决这个问题就要使过河时载两个过河,返回时尽量只有一个回来。用一个字符串数组来存猎人,狼,羊,白菜;下标依次为0,1,2,3;但他们都有河这...
关于猎人过河问题 要解决这个问题就要使过河时载两个过河,返回时尽量只有一个回来。用一个字符串数组来存猎人,狼,羊,白菜;下标依次为0,1,2,3;但他们都有河这边和那边两种状态;为方便则定义一个结构,只含一个int型变量n;当在河这边时n设为0;在河那边时n设为1。由于每次过河与返回都要考虑狼能否吃羊或羊能否吃白菜;则需要一个函数来判断每次选择是否满足条件。-Hunters across the river on the issues to resolve this issue so we should cross the river when the two set out across the river to return to when there is only one back as far as possible. Using a string array to keep hunters, the wolf, sheep, and cabbage subscript followed by 0,1,2,3 but they have a river here and there two states To facilitate the definition of a structure containing only an int variable n When in the river here when n is set to 0 in the river when n is set to one side. Due to cross the river and return each time to consider whether the wolf can eat the sheep吃羊or cabbage you need a function to determine each choose whether or not to meet the conditions.
- 2022-09-15 08:35:04下载
- 积分:1
-
Implimented SLL(Singly Link List)
包装控制台类型操作。
- 2022-03-03 00:31:09下载
- 积分:1
-
chapter 5 of c programe
谭浩强 《c程序设计》,第五章的例题及大部分习题。-chapter 5 of c programe
- 2022-11-09 16:10:04下载
- 积分:1
-
A program shows how to implement the Huffman code contains encoding and decodi...
这是一个有关哈夫曼编码的软件,包括哈夫曼的编码和翻译.-A program shows how to implement the Huffman code contains encoding and decoding
- 2022-02-15 00:55:31下载
- 积分:1
-
二叉树的创建,预
二叉树的创建、前序递归遍历、中序递归遍历、后序递归遍历、层次遍历、前序非递归遍历、中序非递归遍历、后序非递归遍历算法。里面包含了顺序栈和队列的实现代码。-Binary tree creation, pre-order recursive traversal, recursive in order traversal, postorder recursive traversal, traverse the level, pre-order traversal non-recursive, in the non-recursive traversal sequence after sequence of non- recursive traversal algorithm. Which contains a sequence of stack and queue the realization of the code.
- 2023-07-03 07:40:02下载
- 积分:1
-
derectional input and output of console application program
控制台应用程序定向输入和输出-derectional input and output of console application program
- 2022-03-12 12:46:40下载
- 积分:1
-
this program can be set to automatically process implementation, user
本程序可以设置程序为自动被执行,使用方便,使程序在您需要的时候被自动执行!-this program can be set to automatically process implementation, user-friendly process, in the time you need to be self-executing.
- 2023-01-30 04:15:03下载
- 积分:1
-
vc++ procedure, a small
vc++程序,一个小型的项目,非常棒-vc++ procedure, a small-scale projects, great
- 2022-03-07 02:46:02下载
- 积分:1
-
实现NFA到DFA的转换,是编译原理的一个更好的参考…
实现NFA到DFA的转换,是编译原理初学者比较好的参考资料-Achieve NFA to DFA conversion, the principle is to compile a better reference for beginners
- 2022-03-01 20:34:53下载
- 积分:1
-
二叉树的应用
利用结构体变量定义了二叉树的指针,完成二叉树的创立可以利用头插法或者尾插法实现。再创立二叉树的过程中直接创立平衡二叉树,然后再平衡二叉树中插入新的节点,此时平衡二叉树失去平衡,重新调整直至平衡。然后再删除一个节点,再重新调整平衡二叉树。还是实现了查找关键字的处理。
- 2023-07-27 09:00:03下载
- 积分:1