摘要: 1 package com.datastack.stack; 2 3 import java.util.Arrays; 4 5 //栈 6 public class Stack { 7 private int max; 8 private int[] arr; 9 private int top = -1; 10 11 //构造器 ... 阅读全文
posted @ 2019-09-22 10:38 az1l3l 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 1 package com.datastack.search; 2 3 import java.util.Arrays; 4 5 //插入排序 6 public class InsertSort { 7 public static void main(String[] args) { 8 int[] arr = new int[]{1,3,5,2,5,5,512,231,123,556,669}; 阅读全文
posted @ 2019-09-22 10:20 az1l3l 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 1 package com.datastack.search; 2 3 import java.util.Arrays; 4 5 //选择排序 6 public class SelectSort { 7 public static void main(String[] args) { 8 int[] arr = new int[] {5,3,2,54,5,1,23,5,3,2,3,1,5,65}; 阅读全文
posted @ 2019-09-22 10:05 az1l3l 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 1 package com.datastack.search; 2 3 import java.util.Arrays; 4 5 //冒泡排序 6 public class BubSearch { 7 public static void main(String[] args) { 8 int[] arr = {6,1,8,23,3,5,6,9,12}; 9 int temp; 10 for(in 阅读全文
posted @ 2019-09-22 09:52 az1l3l 阅读(151) 评论(0) 推荐(0) 编辑
摘要: package com.datastack.search; /** * 二分查找 */ public class BinarySearch { public static void main(String[] args) { int[] arr = new int[]{1,2,3,4,5,6,7,8 阅读全文
posted @ 2019-09-22 09:41 az1l3l 阅读(156) 评论(0) 推荐(0) 编辑