文件名称: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.
初设置在数组中的一个最大值,使得最小子序列及最小子序列初始化。记录在当前位置的最小子序列数,接着,继续与在其前面相邻的数进行比较。如果后者大于前者,者比较二者携带记录的最小子序列数的大小,如果后者持有的最小子序列数大于前者,则以后者为基准,最小子序列保持不变。反之,则将后者的子序列数自加一,将其改为前所持有的最小子序列数。继续重复前面的动作,最后得出最长不下降子序列的数目及内容。
-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