搜索资源列表
ch09_05
- 编写返回数组中最大元素数值的模板函数。输入为两行,第一行为元素的个数n,第二行为n个元素。输出见main函数。 -Write a template function returns the value of the largest element in the array. Input for the two lines of the first acts of the number of elements n, n elements of the second act. Output, s
Post-Office
- 算法设计与分析中邮局选址问题。 select(int[] array, int begin, int end, int middle)将n个输入元素划分成n/5个组,每组5个 元素,只可能有一个组不是5个元素。用任意一种排序算法,将每组中的元素排好序,并取出每组的中 位数,共n/5个。找出这n/5个元素的中位数。如果n/5是偶数,就找它的2个中位数中较大的一个。 以这个元素作为划分基准。在调用时,只需要将middle参数传入array.length/2就能找到整个数组中的
shuzu
- 对输入的整型数组,输出数组元素中的最大值、最大值的个数、最小值和最小值的个数.根据数组知识结合指针进行实现。-Integer array of input and output array element maximum number of maximum, minimum, and the number of minimum. According to achieve a good array of knowledge.
函数模板
- C++;使用函数模板求一维数组中的最大和最小值;使用函数模板求一维数组中的最大和最小值(Using function template to find the maximum and minimum values in one-dimensional array.)