联合开发网   搜索   要求与建议
                登陆    注册
排序按匹配   按投票   按下载次数   按上传日期
按分类查找All 数值算法/人工智能(63) 
按平台查找All Visual C++(63) 

[数值算法/人工智能] Fibonacci

试利用循环队列编写求k阶斐波那契序列中前n+1项的算法。 要求满足: (注意:本题所用循环队列的容量仅为k, 则在算法执行结束时,留在循环队列中的元素应是所求k阶斐波那契序列中的最后k项)
Try using a circulating queue write seeking algorithms k n+ 1-order Fibonacci term lease before that sequence. Requirements are met: (Note: This question of the capacity of only circular queue element k, at the end of the algorithm execution, stay in the loop with the queue should be required sequence of order k Fibonacci last item k) (2016-06-20, Visual C++, 2KB, 下载2次)

http://www.pudn.com/Download/item/id/1466403350290606.html

[数值算法/人工智能] shunxubiaohelianbiao

(1).对顺序表的快速排序算法中,如何选取一个界值(又称为轴元素),影响着快速排序的效率,而且界值也并不一定是被顺序表中的一个元素。例如,我们可以用被划分序列中所有元素的平均值作为界值。编写算法实现以平均值为界值的快速排序方法。 (2).设有n个待排序元素存放在一个不带表头结点的单链表中, 每个链表结点只存放一个元素, 头指针为r。试设计一个算法, 对其进行二路归并排序, 要求不移动结点中的元素, 只改各链结点中的指针, 排序后r仍指示结果链表的第一个结点。
(1). Fast sorting algorithm order of the table, how to choose a community value (also known as an axis element), affecting the efficiency of quick sort, and community values are not necessarily sequential list is an element. For example, we can be divided by the average of all the elements in the sequence as the cutoff value. Write algorithm is bounded to the average value of fast sorting method. (2). There n elements to be sorted is stored in a single list without meter nodes, each node lists only a storage element, the head pointer r. Try to design an algorithm, its way merge sort, asked not to move the nodes of elements, each link points only change pointers sorted r still indicates the result list of the first node. (2016-05-22, Visual C++, 1124KB, 下载1次)

http://www.pudn.com/Download/item/id/1463921773503409.html

[数值算法/人工智能] 2.12

设A=(a1,…,am)和B=(b1,…,bn)均为顺序表,A’和B’分别为A和B中除去最大共同前缀后的子表(例如,A=(x,y,y,z,x,z),B=(x,y,y,z,y,x,x,z),则两者中最大的共同前缀为(x,y,y,z),在两表中除去最大共同前缀后的子表分别为A’=(x,z)和B’=(y,x,x,z))。若A’=B’=空表,则A=B;若A’=空表,而B’≠空表,或者两者均不为空,且A’的首元小于B’的首元,则A < B,否则A > B。试写一个比较A、B大小的算法(请注意:在算法中,不要破坏原表A和B,并且也不一定先求得A’和B’才进行比较)。
设A=(a1,…,am)和B=(b1,…,bn)均为顺序表,A’和B’分别为A和B中除去最大共同前缀后的子表(例如,A=(x,y,y,z,x,z),B=(x,y,y,z,y,x,x,z),则两者中最大的共同前缀为(x,y,y,z),在两表中除去最大共同前缀后的子表分别为A’=(x,z)和B’=(y,x,x,z))。若A’=B’=空表,则A=B;若A’=空表,而B’≠空表,或者两者均不为空,且A’的首元小于B’的首元,则A < B,否则A > B。试写一个比较A、B大小的算法(请注意:在算法中,不要破坏原表A和B,并且也不一定先求得A’和B’才进行比较)。 (2016-04-20, Visual C++, 918KB, 下载5次)

http://www.pudn.com/Download/item/id/1461162124976901.html

[数值算法/人工智能] Josephus

任给正整数n、k,按下述方法可得排列1,2,……,n的一个置换:将数字1,2,……,n环形排列(如图2-36所示),按顺时针方向从1开始计数,计满k时输出该位置上的数字(并从环中删去该数字),然后从下一个数字开始继续计数,直到环中所有数字均被输出为止。试编写一算法,对输入的任意正整数n、k,输出相应的置换数字序列。
Given any positive integer n, k, can be obtained as described below arrangement 1,2, ......, a permutation of n: the digital 1,2, ......, n arranged in a ring (as shown in Figure 2-36), press Clockwise 1 starts counting, output figures in this position (and delete the number the ring) at the expiration of k, then resumes counting the next number, until all numbers are output in the ring so far. Try to write an algorithm to enter any positive integer n, k, outputs a corresponding displacement sequence of numbers. (2015-12-21, Visual C++, 1669KB, 下载1次)

http://www.pudn.com/Download/item/id/1450705392825198.html

[数值算法/人工智能] Hanoi

汉诺塔问题比较经典,经过一段时间自己玩了一下网上的示例后,发现,尽管以东的步骤非常多,也比较繁琐,但是其中有较强的规律性,主要是通过塔盘的逐步移动,将最后的大的塔盘移动到最后的塔盘架上,整个的过程可以用算法实现。
this is a hanoi problem. (2015-12-03, Visual C++, 2791KB, 下载1次)

http://www.pudn.com/Download/item/id/1449139562403008.html

[数值算法/人工智能] 5-1

5-1 子集和问题 问题描述:子集和问题的一个实例为<S,t>。其中,S={x1,x2,...,xn}是一个正整数的集合,c是一个正整数 。 子集和问题判定是否存在S 的一个子集S1,使得子集里的元素之和为c 试设计一个解子集和问题的回溯法。 算法设计:对于给定的正整数的集合S={x1,x2,...,xn}和正整数c,计算S的一个子集S1,使得子集里的元素之和为c。 数据输入:由文件input.txt提供输入数据。文件第1行有2个正整数n和c,n表示S的大小,c是子集和的目标值。 接下来的1行中,有n个正整数,表示集合S中的元素。 结果输出:将子集和问题的解输出到文件output.txt。当问题无解时,输出 No Solution! 。 输入文件示例 输出文件示例 input.txt output.txt 5 10 2 2 6 2 2 6 5 4
5-1 it s a problam about size. (2015-10-11, Visual C++, 896KB, 下载8次)

http://www.pudn.com/Download/item/id/1444555588498950.html

[数值算法/人工智能] best_distance

某工厂自国外进口一部机器,需从制造厂A运到目的地E。运输期间可能会发生的运输成本如下图所示。试求运输成本最低的路线(用动态规划法编程求解),动态规划的经典实例,这里扩大了算法的使用情况并作出了优化改进,对常见的本算法的缺漏进行了弥补
A factory a machine imported abroad, to be shipped the manufacturer to the destination E. A Transportation costs may occur during transport is shown below. Find the lowest shipping cost route (with dynamic programming method to solve the program), Dynamic Programming classic example, where the expansion of the algorithm to optimize usage and made improvements to the common of the algorithm was to make up for missing (2015-05-09, Visual C++, 2KB, 下载1次)

http://www.pudn.com/Download/item/id/1431169714143727.html

[数值算法/人工智能] lading

拉丁矩阵问题: 现有N种不同形状的宝石,每种宝石有足够多颗。欲将这些宝石排列成m行n列的一个矩阵,m<=n,使矩阵中每一行和每一列的宝石都没有相同形状。试设计一个算法,计算出对于给定的m和n,有多少种不同的宝石排列方案。 算法设计: 对于给定的m和n,计算出不同的宝石排列方案数。
Latin matrix problem: Existing N different shapes of stones, each gem has enough teeth. The stones are arranged in a matrix wishing m rows and n columns, m < = n, the matrix so that each row and each column do not have the same shape as the jewel. Try to design an algorithm to calculate for a given m and n, there are many different kinds of gems arranged plan. Algorithm Design: For a given m and n, the program calculates the number of different permutations gems. (2014-07-21, Visual C++, 1KB, 下载5次)

http://www.pudn.com/Download/item/id/2592531.html

[数值算法/人工智能] suanfabijiao

对常用的内部排序算法进行比较:直接插入排序、简单选择排序、冒泡排序、快速排序、希尔排序(在教科书中,各种内部排序算法的时间复杂度分析结果只给出了算法执行时间的阶,或大概执行时间。试通过随机数据比较各算法的关键字比较次数和关键字移动次数,以取得直观感受。)
Internal sorting algorithm commonly used for comparison: direct insertion sort, simple selection sort, bubble sort, quick sort, Hill (in textbooks, various internal sorting algorithm time complexity analysis gives only the execution time of the algorithm The order, or about the execution time. trial comparing the data through random algorithms compare the number of keywords and keyword number of moves to get an intuitive feel.) (2013-11-09, Visual C++, 2KB, 下载2次)

http://www.pudn.com/Download/item/id/2396284.html

[数值算法/人工智能] ACM-magicANDlawn

假设有n根柱子,现要按下述规则在这n根柱子中依次放入编号为1,2,3,...的球。 (1)每次只能在某根柱子的最上面放球。 (2)在同一根柱子中,任何2个相邻球的编号之和为完全平方数。 试设计一个算法,计算出在n根柱子上最多能放多少个球。例如,在4 根柱子上最多可 放11 个球。 编程任务: 对于给定的n,计算在n根柱子上最多能放多少个球。
Suppose there are n pillars, according to the following rules are in this n pillars placed sequentially numbered 1,2,3, ... balls. (1) Each time only in the top of a pillar to put the ball. (2) In the same pillar, any two adjacent numbers of balls for the perfect square. Try to design an algorithm to calculate the n pillars can put up to how many balls. For example, in a maximum of four pillars Put 11 balls. Programming tasks: For a given n, compute the n pillars can put up to how many balls. (2013-10-17, Visual C++, 1KB, 下载3次)

http://www.pudn.com/Download/item/id/2376846.html

[数值算法/人工智能] a32

设有n 种不同的钱币各若干张,可用这n 种钱币产生许多不同的面值。试 设计一个算法,计算给定的某个面值,能有多少种不同的产生方法。例如有1 分3 张,2 分 3 张,5 分1 张,则能组成7 分面值的方法有:3 个1 分+2 个2 分,1 个1 分+3 个2 分,2 个1 分+1 个5 分,1 个2 分+1 个5 分共四种。
With n different number of sheets of each coin, can produce these n many different kinds of coin denomination. Try to design an algorithm to calculate a given nominal value, can have many different methods of production. For example there is a sub-3, 2 points 3, 5 1, the nominal value can be composed of seven points are: 3 points 2 points 1 point+2, a 1 minute+3 a 2 points, 2 1 minute+1 5 points, 2 points+1 a total of four points in five minutes. (2013-09-06, Visual C++, 57KB, 下载4次)

http://www.pudn.com/Download/item/id/2349182.html

[数值算法/人工智能] jsj-suanfashiyanbaogao

设a[0:n-1]是有n个元素的数组,k(0≤k≤n-1)是一个非负整数。试设计一个算法将子数组a[0:k-1]与a[k:n-1]换位。要求算法在最坏的情况下耗时0(n),且只用到0(1)的辅助空间。
Let A [0: n-1] is an array of n elements, k (0 ≤ k ≤ n-1) is a non-negative integer. The trial design of an algorithm of the sub-array A [0: k-1] and a [k: n-1] transposition. The algorithm in the worst case Processed 0 (n), 0 (1) and only used auxiliary space. (2013-04-05, Visual C++, 21KB, 下载11次)

http://www.pudn.com/Download/item/id/2186559.html

[数值算法/人工智能] 1

已知整数a,b,假设函数succ(x)=x+1,pred(x)=x-1,不许直接用‘+’、‘-’运算符号,也不许用循环语句,只能利用函数succ(x)和pred(x),试编写计算a+b,a-b的递归函数add(a,b),snb(a,b),并在主程序中验证该函数的正确性。
Known integers a, b, assuming the function succ (x) = x+1, pred (x) = x-1, allowed the direct use of' +' ,' -' operational symbol, also not allowed to use the loop, only use the function succ (x) and pred (x), test preparation calculate a+ b, ab recursive function add (a, b), snb (a, b), and in the main program verify the correctness of the function. (2011-05-14, Visual C++, 1KB, 下载2次)

http://www.pudn.com/Download/item/id/1530920.html

[数值算法/人工智能] ETS

有一推销员,欲到n(n<=10) 个城市推销产品。为了节省旅行费用,在出发前他查清了任意两个城市间的旅行费用,想找到一条旅行路线,仅经过每个城市一次,且使旅行费用最少。本问题已知城市n,和n*n的表达任意两个城市间费用的矩阵。试求最短路径及其费用;
A salesman, wants to n (n < = 10) cities to promote their products. To save travel costs, find out before his departure, arbitrary travel between two cities, would like to find a travel route through each city only once, and to travel at least. This problem is known to city n, and n* n the expression of any two cities the cost matrix. Find the shortest path and its cost (2010-05-15, Visual C++, 1KB, 下载5次)

http://www.pudn.com/Download/item/id/1174009.html

[数值算法/人工智能] WorkAssignment

acm算法设计 设有n件工作分配给n个人。将工作i 分配给第j 个人所需的费用为Cij。试设计一个算法,为每一个人都分配1 件不同的工作,并使总费用达到最小。 设计一个算法,对于给定的工作费用,计算最佳工作分配方案,使总费用达到最小。 输入:第一行有1 个正整数n (1≤n≤30)。接下来的n行,每行n个数,表示工作费用。 输出:最小总费用。 例输入: 3 10 2 3 2 3 4 3 4 5 例输出:9
acm algorithm design with n pieces of work assigned to the n individuals. I will be allocated to the work of the first j for the cost of personal Cij. Try to design an algorithm for each individual a different allocation of effort and minimize the total cost. To design an algorithm for a given cost of the work to calculate the best distribution of work to minimize the total cost. Input: the first line there is a positive integer n (1 ≤ n ≤ 30). N the next line, n the number of each line, the cost of that work. Output: the minimum total cost. Cases of type: 31,023,234,345 cases output: 9 (2009-06-12, Visual C++, 347KB, 下载17次)

http://www.pudn.com/Download/item/id/804343.html

[数值算法/人工智能] guff

在一个操场的四周摆放着n 堆石子。现要将石子有次序地合并成一堆。规定在合并过程 中最多可以有m(k)次选k 堆石子合并成新的一堆,2≤k≤n,合并的费用为新的一堆的石子 数。试设计一个算法,计算出将n 堆石子合并成一堆的最小总费用。
In a playground around the stones are placed n heap. Stone is to have the order to merge into a pile. Provisions in the merger process can have up to m (k) election k heap stones into a pile of new, 2 ≤ k ≤ n, the combined cost for the new pile of stones a few. Try to design an algorithm to calculate the n heap a pile of stones into the smallest total cost. (2008-05-31, Visual C++, 2KB, 下载5次)

http://www.pudn.com/Download/item/id/478547.html

[数值算法/人工智能] vc91445348451251

课程安排,用拓扑排序实现 4、实现课程的拓扑排序。(选)(加) 问题描述:软件专业的学生要学习一系列课程,其中有些课程必须在其先修课程完成后才能学习,具体关系见下表: 课程编号 课程名称 先决条件 C1 程序设计基础 无 C2 离散数学 C1 C3 数据结构 C1,C2 C4 汇编语言 C1 C5 操作系统 C3 假设每门课程的学习时间为一学期,试为该专业的学生设计教学计划,使他们能在最短的时间内修完这些课程。
Curriculum, using topological sorting realize 4 courses realize topological sort. (Election) (Canada) Problem Description: Software professional students to learn a series of courses, some of which courses must be completed in its prevocational curriculum in order to learn the specific relationship between the table below: Course Code Course Title prerequisite program design based on non-C1 C2 Discrete Mathematics C1C3 data structure C1, C2C4 assembly language operating system C1C5 assumption C3 for each course of study time for one semester, the students test the design of teaching programs, so that they can in the shortest time possible to complete these courses. (2008-05-09, Visual C++, 130KB, 下载79次)

http://www.pudn.com/Download/item/id/457559.html

[数值算法/人工智能] StoreMerger

算法设计。题目要求:在一个圆形操场的四周摆放着n 堆石子。现要将石子有次序地合并成一堆。规定每次只能选相邻的2 堆石子合并成新的一堆,并将新的一堆石子数记为该次合并的得分。试设计一个算法,计算出将n堆石子合并成一堆的最小得分和最大得分。
Algorithm design. Title Requirements: playground in a circle around the stones are placed n heap. Stone is to have the order to merge into a pile. Provisions can only choose 2 adjacent stones piled into a heap of new and new pile of stones a few in mind for its combined score. Try to design an algorithm to calculate the n heap into a pile of stones the minimum scores and maximum scores. (2007-12-26, Visual C++, 36KB, 下载15次)

http://www.pudn.com/Download/item/id/383092.html

[数值算法/人工智能] dist

对于给定的m 个整数a 1 , a 2,… a i …a m 组成的向量A, |a i | <=m,和另一个由n个整数 组成的向量B, b1 , b 2,… b i… b n |bi | <=n,试设计一个O (m+n) 时间算法, 计算给定向量A和B的距离dist
For a given integer m of a 1, a 2, ... ai ... am composed of vector A, | ai | <= m, and another by an integer n-vector composed of B, b1, b 2, ... bi ... bn | bi | <= n, try to design a O (m+ n) time algorithm to calculate the amount of A and B orientation the distance dist (2007-11-13, Visual C++, 1KB, 下载5次)

http://www.pudn.com/Download/item/id/360014.html

[数值算法/人工智能] 最大k乘积问题

/*最大k乘积问题 问题描述: 设I是一个n位十进制整数。如果将I划分为k段,则可得到k个整数。这k个整数的乘积称为I的一个k乘积 。 试设计一个算法,对于给定的I和k,求出I的最大k乘积(n<=10)。 示例:输入为 : 4 3 结果:1234 */
/ k* Product of the biggest problems Description : I set up is a n-bit decimal integer. If I will be divided into k, k may be integral. This integer k, the product I called a k product. Design of a test algorithm, to the I and k, I obtained the greatest product of k (4; = 10). Example : Admission : 4 3 : 1234* / (2005-04-07, Visual C++, 1KB, 下载36次)

http://www.pudn.com/Download/item/id/1112841173228957.html
1234
总计:63