搜索资源列表
Ktongfa
- 著名的大数量的排序算法--K桶排序法~在数据文本式的大数据排序时,K桶法会是一个不错的选择! k桶法:k桶法有两个主要步骤:分桶,整合。 分桶:把n个数依次放入k个桶中,除了第k个桶外,放入前k 1个桶中的数都要求后一个大于 前一个。分桶的具体规则如下: 第1个数放入第一个桶内,第2个数若大于第一个桶中的数(即第一个数)则放入第一个桶内, 否则放入第二桶内,以此类推。设现要将第j个数放入某桶中,先从第一个
max-min
- 编写一个程序,读入5个整数,然后确定并显示这组数中的最大整数和最小整数。-Write a program that reads five integers, then determine and display this group of the number of the biggest integer and smallest integer.
find_maximum_and_second_maximum
- 在长度为n的数组a中,寻找最大值和第二大值-Find the value of the maximum and the second largest
as
- 编写C语言程序,模拟UNIX磁盘空间管理中使用的分组链接法。 1.定义一个记录磁盘块号的堆栈S—free[10],以及记录栈中现有磁盘块数的变量S—nfree。 2.定义一个由40个元素构成的结构数组block[40]用作磁盘块存放。 struct size { int blocl[10] } struct blocd { struct size a[10] //用于在空闲磁盘块号链中存放磁盘块号
5-1
- A[n]为整数数组,递归算法实现: (1) 求数组A中的最大整数。 (2) 求n个整数的和。 (3) 求n个整数的平均值。 -A [n] is an integer array, recursive algorithm: (1) Find the largest integer in the array A. (2) Find n integers and. (3) Find the average of n in
Weapon
- 1)、定义一个抽象类Weapon,该抽象类有两个抽象方法attack(),move():这两个方法分别表示武器的攻击方式和移动方式。 (2)、定义3个类:Tank,Flighter,WarShip都继承自Weapon,分别用不同的方式实现Weapon 类中的抽象方法。 (3)、写一个类Army,代表一支军队,这个类有一个属性是Weapon数组w(用来存储该军队所拥有的所有武器);该类还提供一个构造方法,在构造方法里通过传一
20110305012
- 数组倒置,数列相乘,数组的输入输出 求数组中最大的数-Array of inverted series array of input and output requirements by multiplying the largest number of array
Desktop
- 1求矩阵中的 最大值 并返回所在的行数与列数。2判断一组数据满足什么分布,包括泊松分布、正态分布、卡方分布、T分布等。3 检验线性方程组 系数的输入是否有误。-1 find the maximum value and returns the matrix where the rows and columns. 2 to determine what set of data to meet the distribution, includ
101
- 若矩阵Am×n中的某个元素aij是第i行中的最小值,同时又是第j列中的最大值,则称此元素为该矩阵中的一个马鞍点。假设以二维数组存储矩阵Am×n ,试编写求出矩阵中所有马鞍点的算法。 注意一行(列)中可能有多个最小(大)值 可用下列矩阵进行测试: 1 2 3 1 1 1 4 7 6 2 2 2 7* 7* 9 3* 3* 3* (*表示马鞍点) -If the matrix Am × n aij is an
Java
- Java数组的应用: 1、二维数组中求最大最小值 2、数字排序_字母 3、数组的经典算法 4、数组的逆序 5、杨辉三角-Java array of applications: 1, two-dimensional array in seeking maximum and minimum 2 letters numbers sort _ 3, the array of classic algorithms 4, 5 Y
paixu
- 用指向指针的方法对n个数进行排序并输出,n和各整数在主函数中输入-#include <stdio.h> #define SIZE 100//数组最大长度 #define SWAP(x, y, t) (t = x, x = y, y = t)//交换两个数 void sort(int**p, int n){//排序函数 int i, j int min int temp for
asmmaxandmin
- 求最大和最小数。从一组无符号字节数中找出最大和最小的两个数据,并将结果显示出来。这组数据用回车符的ASCII码“0D”作为结束标志。-Find the maximum and minimum number. From an unsigned number of bytes to find the maximum and minimum of two data and the results are displayed. This set
CPPprogram
- 编写程序实现输入整数n,输出如下所示由数字组成的菱形。 输入4×4的数组,编写程序实现: (1)求出对角线上各元素的和; (2)求出对角线上行、列下标均为偶数的各元素的积; (3)找出对角线上其值最大的元素和它在数组中的位置。 用递归法将一个整数n转换成字符串。例如,输入483,应输出字符串“483”。n的位数不确定,可以是任意位数的整 有一字符串,包含n个字符。写一函数,将此字符串中从第m个字符开始的全部字
select-max-from-min
- 模式识别中的最大最小距离算法,这程序处理二维数据,我发现网上的程序都是设置一个很大的数组,但本程序是无论多少数据样本都可以处理的。结果存放在两个数组中,z数组存放中心数据,r数组的cente是样本所属的S-Maximum and minimum distance algorithm in pattern recognition, this program deal with two-dimensional data, I found t
sort
- 简单的c++排序算法一:高级排序算法它的工作看起来仍然象一个二叉树。首先我们选择一个中间值middle程序中我们使用数组中间值,然后把比它小的放在左边,大的放在右边(具体的实现是从两边找,找到一对后交换)。然后对两边分别使用这个过程(最容易的方法——递归)。-Simple c++ sorting algorithm: Advanced sorting algorithm it still looks like a binary tree
2
- 若矩阵Am?n中的某一元素A[i][j]是第i行中的最小值,同时又是第j列中的最大值,则称此元素为该矩阵的一个鞍点。假设以二维数组存放矩阵,试编写一个函数,确定鞍点在数组中的位置(若鞍点存在时),并分析该函数的时间复杂度。 -If the matrix Am? N of an element A [i] [j] is the minimum value of the i-th row, is also the maximum val
zuidazhi
- 题目:输入一个整形数组,数组里有正数也有负数。数组中连续的一个或多个整数组成一个子数组,每个 子数组都有一个和。求所有子数组的和的最大值。要求时间复杂度为O(n)。 -Title: Enter a plastic array, the array positive also negative. Continuous one or more integer array is composed of a sub-array, and
mp
- /*冒泡排序-----从大到小 *前一个和后一个两两比较,若小于则交换,直到最后一个元素,即小的冒泡,大的下沉 *每一循环都会从待排序的数中找出一个最小值,排到这组数据的最末端或首段,即冒泡 *对于n个数冒泡排序的最大趟数是n - 1,每一趟排序都会在这组待排序的数中产生一个最小值, */-/* Bubble sort----- from largest to smallest* before and after a t
TwoDimensional
- 二维表1、 编写一个Java应用程序,计算并输出一维数组(9.8,12,45,67,23,1.98,2.55,45)中的最大值和最小值。-Dimensional table, write a Java application to calculate and output the maximum and minimum values of the one-dimensional array (9.8,12,4
dan
- // 堆排序 // 初始调用BuildMaxHeap将a[1..size]变成最大堆 // 因为数组最大元素在a[1],则可以通过将a[1]与a[size]互换达到正确位置 // 现在新的根元素破坏了最大堆的性质,所以调用MaxHeapify调整, // 使a[1..size-1]成为最大堆,a[1]又是a[1..size-1]中的最大元素, // 将a[1]与a[size-1]互换达到正确位置。 // 反复调用