- 博客(3)
- 收藏
- 关注
原创 QuickSort c++
QuickSort c++ 简介 算法导论 原理 from Wiki 非常快的排序方法 利用了数组有序的位置不用参与排列 (主元之外) 执行顺序: 左侧排序完 在执行右侧 实验结果: C++ code #include"QUICKSORT.h" #pragma once #include<vector> int Partition(std::vector<int>& A, const int& p, const int& r) { int x =
2020-10-15 21:36:44
256
原创 Find_Maximum_Subarray C++
Find_Maximum_Subarray 最大子数组一定在三种情况中: A[low,mid] , A[mid+1,high] ,A[i,j] Divide: 2分方式: if (low == high) return { low,high,A[low] }; else { int mid = (low + high) / 2; //vec_f = left_low,left_high,left_sum auto vec_f = Find_Maximum_Subarray(A, low
2020-10-14 18:39:19
409
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人