
剑指offer
MLlotus
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
剑指offer-面试题9-用两个栈实现队列&用两个队列实现栈
一:用两个栈实现队列import java.util.Stack;public class Solution { Stack<Integer> stack1 = new Stack<Integer>(); Stack<Integer> stack2 = new Stack<Integer>(); publi...原创 2018-12-01 11:17:02 · 161 阅读 · 0 评论 -
剑指offer-面试题8-二叉树的下一个节点
package offer;public class offer_8<E extends Comparable<E>> { private class Node{ E e; Node left,right,parent; ...原创 2018-12-01 09:22:11 · 175 阅读 · 0 评论 -
剑指offer-面试题6-从头到尾打印链表
方法一:用栈基于循环实现import java.util.ArrayList;import java.util.Stack;public class Solution { public ArrayList<Integer> printListFromTailToHead(ListNode listNode) { Stack<Integer>...原创 2018-11-23 10:41:11 · 132 阅读 · 0 评论 -
剑指offer-面试题3-二维数组中的查找
算法过程:1.选取数组中右上角的数字2.如果该数字小于target,则删除这个数字所在的行row++3.如果该数字大于target,则删除这个数字所在的列column--public class Find { public static boolean findNum(int[][] matrix,int target) { ...原创 2018-11-18 21:43:52 · 120 阅读 · 0 评论 -
剑指offer-面试题2-不修改数组找出重复的数字
package offer;public class Duplication { private int countRange(int[] arr,int l,int r) { int count=0; ...原创 2018-11-17 21:16:26 · 141 阅读 · 0 评论