- 博客(3)
- 收藏
- 关注
原创 Java 二分查找
public class Binary_Search{ public static void main(String[] args) { System.out.println(binarySearch(new int[]{1, 3, 5, 6, 7, 9}, 6)); } public static int binarySearch(int[] arr, int target) { int left = 0, right = arr.length;.
2021-10-07 21:59:55
187
原创 用两个栈实现队列
剑指offer5 用两个栈实现队列 直接上代码在解释 package 剑指offer.JZ5用两个栈实现队列; import java.util.Stack; /** * 实现队列 队列 先进先出 */ public class Solution { Stack<Integer> stack1 = new Stack<>(); Stack<Integer> stack2 = new Stack<>(); public void
2021-06-24 18:15:23
199
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅