Ex4-22 单射函数问题 « 问题描述: 设函数f将点集S = {0,1, , n -1}映射为f (S) = { f (i) | iÎ S} Í S 。单射函数问题要 从S中选取最大子集X Í S 使f (X )是单射函数。 例如,当n=7, f (S) = {1,0,0,2,2,3,6} Í S 时, X = {0,1,6} Í S 是所求的最大子集。 « 编程任务: 对于给定的点集S = {0,1, , n -1}上函数f,试用抽象数据类型队列,设计一个O(n)时 间算法,计算f的最大单射子集。 « 数据输入: 由文件input.txt 提供输入数据。文件的第1 行有1 个正整数n,表示给定的点集 S = {0,1, , n -1}。第2 行是f (i)的值,0 £ i < n。 « 结果输出: 程序运行结束时,将计算出的f的最大单射子集的大小输出到output.txt中。 输入文件示例 输出文件示例 input.txt 7 1 0 0 2 2 3 6 output.txt 3
上传时间: 2016-05-28
上传用户:tyler
% EM algorithm for k multidimensional Gaussian mixture estimation % % Inputs: % X(n,d) - input data, n=number of observations, d=dimension of variable % k - maximum number of Gaussian components allowed % ltol - percentage of the log likelihood difference between 2 iterations ([] for none) % maxiter - maximum number of iteration allowed ([] for none) % pflag - 1 for plotting GM for 1D or 2D cases only, 0 otherwise ([] for none) % Init - structure of initial W, M, V: Init.W, Init.M, Init.V ([] for none) % % Ouputs: % W(1,k) - estimated weights of GM % M(d,k) - estimated mean vectors of GM % V(d,d,k) - estimated covariance matrices of GM % L - log likelihood of estimates %
标签: multidimensional estimation algorithm Gaussian
上传时间: 2013-12-03
上传用户:我们的船长
Tasks Read the textbook about the details of Vigenére Cipher. Implement the algorithm by C or C++. Requirements You do this lab in a group of two students. Your program should have input and output as follows: csci>a.out --> Please input the key: receptive --> Please input the plain text: wearediscoveredsaveyourself --> The cipher text is : nicvtwqngfzgvtwavzvcqyglmgj -->The original message is: wearediscoveredsaveyourself • You should test your program with several runs.
标签: the Implement algorithm textbook
上传时间: 2013-12-21
上传用户:bruce5996
% decode with soft-input viterbi algorithm 硬判决 % //k=4,r=1/2 %输入数据为软信息,并且数据为均值为1的BPSK调制,如果均值为MEAN,那么62,63,103,104行应做相应修改
标签: soft-input algorithm viterbi decode
上传时间: 2014-10-28
上传用户:aig85
This example code takes and averages 2048 analog measurements from input P1.4 using ADC0, then prints the results to a terminal window via the UART.
标签: measurements averages example analog
上传时间: 2016-06-13
上传用户:xuan‘nian
sorting input lines developed by C++ in linux environment
标签: environment developed sorting input
上传时间: 2013-11-28
上传用户:lgnf
Description 为了宣传本次“网宿科技杯”厦门大学第五届程序设计竞赛,系里面做了两张精美的海报。经过了精确的计算,为了达到最佳美观效果,每张海报都有自己最佳的粘贴位置。但是现在问题是,如果两张海报都要求贴在最佳位置时,很有可能有部分地方会重叠在一起。现在您来判断一下这两张海报是否重叠。 Input 输入包含两行,每一行有四个整数来描述这个海报的最佳粘贴位置,X,Y,W,H(-10000<= X,Y <= 10000)(0 < W, H <= 10000),X,Y表示海报左下角的坐标,W,H分别表示宽度和高度。 Output 输出"Yes"表示两张海报互相重叠(表示存在一个面积大于0的公共区域),否则输出"No"。(不包含引号,注意大小写) Sample Input -10 -10 20 30 0 0 30 20 Sample Output Yes
标签: Description 大学 程序设计 竞赛
上传时间: 2016-06-26
上传用户:gxf2016
The goal of our final project was to design an efficient elevator simulator that can accept input from a user and mechanically operate (on a small scale) a system of 4 floors and 3 elevators using pulleys and stepper motors. Users enter input using physical pushbuttons or the computer. This input is then processed by the MCU and orders are given to the elevators. We attempted to devise an algorithm that can optimally handle any number of floors. This project seemed like a fun challenge and something that had practical applications. Both of us have been frustrated at times by the inefficiency of some of the elevators here at Cornell, and we wanted to see if we could do a better job.
标签: efficient simulator elevator project
上传时间: 2013-11-25
上传用户:cjf0304
huffman decode all you need is input a data so that it will decode
上传时间: 2016-07-05
上传用户:AbuGe
包含拼音和笔画输入的中文输入法,使用VC.NET2003开发.portable Chinese input method includes phonetic input and stroke, the use of VC.NET2003 development, WINCE.NET also can be used to understand the system and the family system!
标签: input portable includes phonetic
上传时间: 2013-12-30
上传用户:15071087253