源代码\用动态规划算法计算序列关系个数 用关系"<"和"="将3个数a,b,c依次序排列时,有13种不同的序列关系: a=b=c,a=b<c,a<b=v,a<b<c,a<c<b a=c<b,b<a=c,b<a<c,b<c<a,b=c<a c<a=b,c<a<b,c<b<a 若要将n个数依序列,设计一个动态规划算法,计算出有多少种不同的序列关系, 要求算法只占用O(n),只耗时O(n*n).
上传时间: 2013-12-26
上传用户:siguazgb
The government of a small but important country has decided that the alphabet needs to be streamlined and reordered. Uppercase letters will be eliminated. They will issue a royal decree in the form of a String of B and A characters. The first character in the decree specifies whether a must come ( B )Before b in the new alphabet or ( A )After b . The second character determines the relative placement of b and c , etc. So, for example, "BAA" means that a must come Before b , b must come After c , and c must come After d . Any letters beyond these requirements are to be excluded, so if the decree specifies k comparisons then the new alphabet will contain the first k+1 lowercase letters of the current alphabet. Create a class Alphabet that contains the method choices that takes the decree as input and returns the number of possible new alphabets that conform to the decree. If more than 1,000,000,000 are possible, return -1. Definition
标签: government streamline important alphabet
上传时间: 2015-06-09
上传用户:weixiao99
是个八数码问题的代码 基于A*算法,倒序将步骤写出
上传时间: 2015-06-09
上传用户:yiwen213
HanNuota a simple small game can automatically display process.
标签: automatically HanNuota display process
上传时间: 2015-06-09
上传用户:Thuan
UoB JADhoc is an AODV Implementation in Java. This is a GZIPed TAR file for the Linux/Unix environments.
标签: Implementation environme JADhoc GZIPed
上传时间: 2014-01-15
上传用户:金宜
UoB JADhoc is an AODV Implementation in Java. This is a GZIPed TAR file for the Linux/Unix environments.
标签: Implementation environme JADhoc GZIPed
上传时间: 2013-12-23
上传用户:sk5201314
一个游戏 the hardware for the game includes a number of displays, each with a button and -- a light, that each represent a bin that can store marbles (beans). -- -- The display indicates the number of marbles in each bin at any given time. -- The light indecates that the present bin is not empty and that pushing the -- button is a valid move in the game. -- -- The button for each display indicates that a player takes the marbles from -- the selected bin, and takes them in his hand. The hand is represented by a -- diplay itself (no button). -- -- Each player has a home bin, located on opposite sides of the game.
标签: the hardware displays includes
上传时间: 2015-06-10
上传用户:cc1015285075
KoLmafia is a cross-platform desktop tool, written in Java (J2SE 1.4 compliant), which interfaces with the online adventure game
标签: cross-platform interfaces compliant KoLmafia
上传时间: 2015-06-10
上传用户:coeus
A bi-directional bubble sort demonstration algorithm * SortAlgorithm.java
标签: bi-directional SortAlgorithm demonstration algorithm
上传时间: 2015-06-10
上传用户:tonyshao
This program uses the database created by MakeAPIDB. It opens a connection * to a database using the same property file used by MakeAPIDB. Then it * queries that database in several interesting ways to obtain useful * information about Java APIs. It can be used to look up the fully-qualified * name of a member, class, or package, or it can be used to list the members * of a class or package.
标签: database connection MakeAPIDB program
上传时间: 2013-11-25
上传用户:miaochun888