自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(6)
  • 收藏
  • 关注

原创 快速排序(java版)

递归式的冒泡排序基本实现public static void quickSort(int[] arr,int left,int right){ int l = left; int r = right; int pivot = arr[(left+right)/2]; int temp = 0; //交换,将小的数放在pivot左边,大的数放在pivot右边 while(l<r){ while(arr[l]<pivot){

2020-05-29 11:07:27 116

原创 希尔排序(java版)

推导public static void shellSort(int[] arr){ int temp=0; //第一轮,第一轮将10个数据分成5组 for (int i=5;i<arr.length;i++){ //遍历各组中所有的元素(共5组,每组有两个元素) for (int j=i-5;j>=0;j-=5){ //如果当前元素大于加上步长后的那个元素,说明

2020-05-28 14:27:15 113

原创 插入排序(java版)

基本推导public static void insertSort(int[] arr){ //第一轮 //定义待插入的数 int insertVal=arr[1]; int insertIndex=1-1;//即arr[1]的前面数的下标 //给insertVal找到插入位置 //1、insertIndex>=0保证给insertVal找到插入位置,不越界 //2、insertVa

2020-05-28 11:03:29 98

原创 选择排序算法JAVA版

推导: public static void selectSort(int[] arr){// 第一轮 int minIndex = 0; int min = arr[0]; for (int j=0+1;j<arr.length;j++){ if (min>arr[j]){ min=arr[j]; minIndex=j;

2020-05-28 10:05:36 170

原创 冒泡排序实现与优化(java版)

基本实现public static void sort(int[] arr){ int temp=0; for (int i = 0; i<arr.length-1;i++){ for (int j =0;j<arr.length-1-i;j++){ if (arr[j]>arr[j+1]){ temp=arr[j];

2020-05-27 13:55:36 559

原创 c++引用

指针引用#include#includeusing namespace std;int main(void){int a=3;int *p=&a;int*&q=p;*q=5;coutsystem("pause");return 0;}函数变量的引用#include#includeusing namespace st

2017-10-11 15:41:23 167

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除