![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
剑指OFFER
chengchaobupt
这个作者很懒,什么都没留下…
展开
-
栈的压入和弹出 判断
思路,用额外的一个栈去存储pushA中的元素,然后按照popA的弹出顺序。 import java.util.ArrayList; import java.util.Stack; public class Solution { public boolean IsPopOrder(int [] pushA,int [] popA) { if(pushA.length==0||...原创 2019-03-28 15:56:47 · 375 阅读 · 0 评论 -
打印1到最大的n位数
使用加法器的思想。 public static void Print1ToMaxOfNDigits_2(int n){ if(n <= 0){ return; } StringBuffer number = new StringBuffer(); for(int i = 0; i < n; i...原创 2019-04-11 22:07:38 · 365 阅读 · 0 评论