![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
donghuangliuyun
人生的程序,尽量少点bug
展开
-
char*cstr 转 ushort
char*cstr 转 ushort原创 2022-04-11 17:39:45 · 412 阅读 · 0 评论 -
C++ 循环链表
使用C++ 创建循环链表,约瑟夫环 上代码: #include <iostream> using namespace std; //约瑟夫环问题 typedef int DataType; typedef struct Node{ DataType data; struct Node *next; }Node; Node *CreateList(DataType a[], int n) { Node *first = new Node(); first-&g原创 2022-03-18 17:43:32 · 2025 阅读 · 0 评论 -
数据结构排序算法之快排序(2)
排序算法之快速排序 //交换顺序表中子表的记录,使枢轴记录到位,并返回其所在位置 //此时在它之前(后)的记录均不大(小)于它 int Partition(int* arr, int low, int high) { int pivotkey = arr[low]; //用子表的第一个记录作枢轴记录 while (low < high) { //从表的两端交替向中间扫描 while ((low < high) &&原创 2022-02-22 16:39:47 · 308 阅读 · 0 评论 -
数据结构排序算法之选择排序(1)
排序算法之选择排序 template <class T> void SelectSort(T *arr, int len) { int min = -1; for(int i = 0; i < len; i++){ min = i; for(int j = i + 1; j < len; j++){ //内层循环目的是找出数组未排序的最小值 if(arr[min] > arr[j]) //判断是否需原创 2022-02-22 16:35:22 · 615 阅读 · 0 评论 -
myvector的实现方法
算法相关原创 2022-01-20 08:54:29 · 513 阅读 · 0 评论