两种解决方案 Richard just finished building his new house. Now the only thing the house misses is a cute little wooden fence. He had no idea how to make a wooden fence, so he decided to order one. Somehow he got his hands on the ACME Fence Catalogue 2002, the ultimate resource on cute little wooden fences. After reading its preface he already knew, what makes a little wooden fence cute. A wooden fence consists of N wooden planks, placed vertically in a row next to each other. A fence looks cute if and only if the following conditions are met: ?The planks have different lengths, namely 1, 2, . . . , N plank length units. ?Each plank with two neighbors is either larger than each of its neighbors or smaller than each of them. (Note that this makes the top of the fence alternately rise and fall.)
标签: house the finished building
上传时间: 2014-01-26
上传用户:541657925
PRIM求最小生成树,JAVA源程序,简洁易懂,很不错的。l
上传时间: 2014-08-04
上传用户:BIBI
数据结构(严慰敏)配套纯c代码实验十 typedef int InfoType // 定义其它数据项的类型 typedef int KeyType // 定义RedType类型的关键字为整型 struct RedType // 记录类型(同c10-1.h) { KeyType key // 关键字项 InfoType otherinfo // 其它数据项 } typedef char KeysType // 定义关键字类型为字符型 #include"c1.h" #include"c10-3.h" void InitList(SLList &L,RedType D[],int n) { // 初始化静态链表L(把数组D中的数据存于L中) char c[MAX_NUM_OF_KEY],c1[MAX_NUM_OF_KEY] int i,j,max=D[0].key //
标签: typedef int InfoType KeyType
上传时间: 2016-03-03
上传用户:2404
假设自上而下按层次,自左至右输入每个结点的一个三元组(N, P, L/R)。其中N为本结点的元素,P为其父结点,L指示N为P 的左孩子,R指示N为P的右孩子。试写一个建立二元树在内存的双链表示算法,并实现先根、中根、后根以及层序遍历算法。
标签: 自上而下
上传时间: 2013-12-17
上传用户:xc216
几种常用的压缩算法 本程序包含以下功能: 1、 Arithmetic coding 2、 Huffman coding 3、 LZ77 coding 4、 LZ78 coding 5、 LZW 6、 RLE 7、 DCT 8、 Furie transform
标签: coding Arithmetic Huffman LZ
上传时间: 2014-01-18
上传用户:caozhizhi
设有一个个人档案文件DOCU,它包含每个人的姓名,年龄,性别,身高和体重这五项内容。其中姓名占10个字节,年龄2个字节,性别1个字节,身高3个字节,体重2个字节。编写一DOCU的管理程序。L为列表表示,I为插入,Q为退出。
标签: DOCU
上传时间: 2014-07-22
上传用户:epson850
(1).问题描述:集装箱的装箱问题 给定一个集装箱,其长为L,宽为W和高为H,现有一批圆柱形木材,每根木材的长均为L,但是半径不同,设第i根木材半径为ri。问如何装箱,使得集装箱的空间利用率最高? (2).程序设计要求: a. 设计一个贪心算法 b. 任给一个输入实例,能输出集装箱的空间利用率 c. 能用图形演示装箱的过程 演示: 输入要测试的文件名,如c17.txt,程序将给出结果,并用图形演示。
标签: 集装箱
上传时间: 2014-01-07
上传用户:miaochun888
Symbian中一些函数命名的规则,从中你会大致了解symbian中的内部类型,TInt TBool 等等的命名由来,以及为什么有些函数要以“L”结束有些函数要以“CL”结束,还有一个project有哪些文件组成,怎么组织等等。
上传时间: 2013-12-17
上传用户:l254587896
you can use this matlab code to change image into different color system such as luv, rgb, yuv and lab
标签: different matlab change system
上传时间: 2016-03-27
上传用户:小眼睛LSL
DESCRIPTION : 0.2S级三相电子式电能表 功能: (1)、LCD显示 (2)、内部通讯:通讯规约采用部颁规约(DL/T645-1997) (3)、红外通讯:通讯规约采用部颁规约(DL/T645-1997) (4)、日历时钟:采用软时钟(TA或TB) (5)、停电或全失压时:低功耗模式3
标签: DESCRIPTION 1997 0.2 645
上传时间: 2016-04-01
上传用户:脚趾头