![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
chaolihaide_jia
这个作者很懒,什么都没留下…
展开
-
排序-归并
归并排序原创 2022-09-23 11:08:31 · 134 阅读 · 1 评论 -
快排 C语言实现
#include<stdio.h>int sort( int * arr, int nLow, int nHigh){ int temp = arr[nLow]; while( nLow < nHigh ) { while( nLow < nHigh ) { if( arr[nHigh] <= temp ) { arr[nLow] =原创 2022-04-14 11:33:30 · 1011 阅读 · 0 评论 -
选择排序 C语言实现
选择排序:思想:从所有记录中选择出最小的一个数据元素与第一个位置的记录交换;然后剩下的记录当中在找最小的与第二个位置交换,循环到只剩下最后一个数据元素位置。稳定性:不稳定。稳定性是指:数值相同两个元素,在排序前后位置未发生改变称为稳定。#include <stdio.h>void SelectSort(int* arr, int length){ if (NULL == arr || length < 0) return; int i, j,minIndex; fo原创 2022-05-22 21:53:50 · 117 阅读 · 0 评论 -
插入排序 C语言实现
#include<stdio.h>void insertsort(int* arr,int length){ if(arr == NULL || length < 0) return; for(int i = 1; i < length; i++) { for(int j = i; j > 0; j--) { if(arr[j-1] > arr[j])原创 2022-05-10 15:40:28 · 243 阅读 · 0 评论