- 博客(5)
- 收藏
- 关注
原创 折半查找并插入(在一个有序数组中通过二分查找数字,若存在,指出其是数组中第几个元素;反之插入数组并有序化)
import java.util.Arrays;import java.util.Scanner;/** * 折半查找(二分查找):从中间找(数组默认排好序了) * @author Family happy Lee * */public class 折半查找并插入 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int[] a = {12,24,35,8.
2021-09-24 17:07:35
128
原创 数组的创建与实例化
package 数组combine构造方法;public class Array { public static void main(String[] args) {/* int[] array1 = null; array1= new int[10]; */ //一维数组的创建 User[] user = null; //栈中声明数组(在栈里生成实例化数组user并定义为空) user =new User[3]; //堆内分配空间(堆里创建一个空间大小为3的实例化数.
2021-09-04 14:49:46
226
原创 递归求10的阶乘
/** * 10!=10*9*8*...*1 * @author Family happy Li * */public class 十的阶乘 { public static void main(String args[]) { System.out.println(factorial(10)); } static long factorial(int n) { if(n==1) { return 1; /.
2021-08-20 11:35:31
442
原创 对象和类™
public class 粉兔叽 { void 匹配() { System.out.println("匹配模式"); } void 排位() { System.out.println("排位模式"); } void 极地大乱斗() { System.out.println("极地大乱斗"); } public static void main(String args[]) { 粉兔叽 LOL = new 粉兔叽(); LOL.匹配(); LOL.排位(); LOL.
2021-08-20 11:28:47
75
原创 Test all various of arithmetic operator
Test all various of arithmetic operator,including Self-increasing,Self-decreasing,Assignment and assignment extension operators,relational operator, logical operator and positional operator as well as shift operation./** * 测试算术运算符 * @author Family hap
2021-08-11 12:34:33
115
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人