- 博客(6)
- 收藏
- 关注
原创 hadoop报错:Error: Could not find or load main class org.apache.hadoop.mapreduce.v2.app.
入门Hadoop
2023-01-31 18:50:50
637
翻译 矩阵乘法 C++
暴力法:#include<iostream>using namespace std;int main() { int a[2][2]; int b[2][2]; int c[2][2]; cout << "输入矩阵a:" << endl; for (int i = 0; i < 2; i++) { for (int j = 0; j < 2; j++) {
2021-07-12 22:02:56
832
2
原创 最大子数组问题 分治法C++版
#include <iostream>#include <string>using namespace std;struct SubArray{ int startIndex; int endIndex; int sum;};struct SubArray FindMaxmumSubarray(int a[], int low, int high) //返回一个下标元组划定跨越中点的最大子数组的边界{ int sum = 0, lmax = -INFINIT.
2021-07-11 22:18:13
305
原创 插入排序 C++版
从数组第一个元素a[j]往前比较,如果比前一个数组元素a[j-1]大,就将该数组元素插到a[j-1]前面去或者与a[j-1]交换位置。交换位置版:#include <iostream>#include <string>using namespace std;void swap(int* a, int* b){ int tmp = *a; *a = *b; *b = tmp;}void print(int a[], int n){ for (int i
2021-07-11 11:21:29
82
原创 冒泡排序 C++
最基础的:#include <iostream>#include <string>using namespace std;void swap(int *a, int *b){ int tmp = *a; *a = *b; *b = tmp;}void print(int a[],int n){ for (int i = 0; i <n; i++) { cout << a[i] << " "; }}void Bub
2021-06-24 20:57:15
260
3
原创 优化版选择排序 C++
遍历一次,同时找出最大值和最小值#include <iostream>#include <string>using namespace std;void swap(int *a, int *b){ int tmp = *a; *a = *b; *b = tmp;}int main(){ int a[] = { 3,4,2,1,6,0,9,5 }; int n = sizeof(a) / sizeof(int); for (int i = 0; i
2021-06-21 21:27:14
154
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人