文件名称:sub-sequence
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:619byte
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
首先开设一个空间比较大的数组,从数组尾部开始。比较最后一个数和最
初设置在数组中的一个最大值,使得最小子序列及最小子序列初始化。记录在当前位置的最小子序列数,接着,继续与在其前面相邻的数进行比较。如果后者大于前者,者比较二者携带记录的最小子序列数的大小,如果后者持有的最小子序列数大于前者,则以后者为基准,最小子序列保持不变。反之,则将后者的子序列数自加一,将其改为前所持有的最小子序列数。继续重复前面的动作,最后得出最长不下降子序列的数目及内容。
-First to open a larger space for the array, starting from the end of the array. Comparison of the last number and the most
Early to set a maximum value in the array, making a minimal sequence and the sequence of a minimal initialization. A minimal sequence number recorded in the current location, and then continue to work with in front of the adjacent number to compare. If the latter than the former, the size of the minimal sequence number of compare the two brought into the record, if the latter holds the minimal sequence number is greater than the former, the latter as a benchmark, a minimal sequence remains unchanged. On the contrary, is the latter sub-sequence number from plus one to change it held before the minimal sequence number. Continue to repeat the previous action, and finally arrive at the number and content of up to drop the sub-sequence.
初设置在数组中的一个最大值,使得最小子序列及最小子序列初始化。记录在当前位置的最小子序列数,接着,继续与在其前面相邻的数进行比较。如果后者大于前者,者比较二者携带记录的最小子序列数的大小,如果后者持有的最小子序列数大于前者,则以后者为基准,最小子序列保持不变。反之,则将后者的子序列数自加一,将其改为前所持有的最小子序列数。继续重复前面的动作,最后得出最长不下降子序列的数目及内容。
-First to open a larger space for the array, starting from the end of the array. Comparison of the last number and the most
Early to set a maximum value in the array, making a minimal sequence and the sequence of a minimal initialization. A minimal sequence number recorded in the current location, and then continue to work with in front of the adjacent number to compare. If the latter than the former, the size of the minimal sequence number of compare the two brought into the record, if the latter holds the minimal sequence number is greater than the former, the latter as a benchmark, a minimal sequence remains unchanged. On the contrary, is the latter sub-sequence number from plus one to change it held before the minimal sequence number. Continue to repeat the previous action, and finally arrive at the number and content of up to drop the sub-sequence.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
sub-sequence/sub-sequence.cpp
sub-sequence
sub-sequence
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.