自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 4.求数组的局部最小值(数组相邻,值比不相等)

// 1.局部最小值问题 保证相邻的连个数不相等 可以找到一个 public static int localMinIndex(int[] arr){ if ( arr ==null || arr.length==0) { return -1; } int N = arr.length; if (N == 1){ return 0; } //前两个 .

2021-12-22 14:48:56 377

原创 3.从1-5的随机到1-7的随机

//(1) 1-5的随机,不能动 1-5等概率随机,基础函数不变public static int f1(){ return (int)(Math.random()*5) + 1;}//(2)根据f1() 1-5等概率,写出 0-1的等概率分布public static int f2(){ int ans = 0; do{ ans = f1(); } while ( ans == 3); return ans < 3 ? 0.

2021-12-17 14:31:11 145

原创 2.基本排序(选择,冒泡,插入)

public class Code_SelectSort { //交换位置 public static void swap(int[] arr,int i,int j){ int temp=arr[i]; arr[i]=arr[j]; arr[j]=temp; } //选择排序 public static void selectSort(int[] arr){ if(null == a.

2021-12-17 14:04:18 224

原创 1.int类型的二进制表示

2021-11-16 11:41:49 2230

空空如也

空空如也

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

TA关注的人

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