自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 Lua——插入算法排序

local function insert_sort(array) for i = 2,#array do local temp = array[i] local index = i- 1--记录插入的数前一个位置的索引 while index >= 1 and array[index] >= temp do array[index+1] = array[index]--//前面的数往后移动一位 ...

2020-10-25 10:47:16 208

原创 Lua——选择算法排序

function select_Sort(array) for i = 1,#array - 1 do local index = i for j = i + 1,#array do if array[j] < array[index] then index = j end end if index ~=i then array[i],array[index]...

2020-10-24 14:56:30 158

原创 Lua——冒泡算法排序

开始学习lua了,记录一下 local var = {1,4,7,2,5,8,3,6,9} local index = #var for i = 1,index - 1 do for j = 1,index - i do if var[j] > var[j+1] then local temp = var[j+1] var[j+1] = var[j] var[j] = temp end ...

2020-10-24 14:45:09 334

空空如也

空空如也

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

TA关注的人

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