若想深度掌握,就要让它跑起来

103 阅读2分钟
持续坚持、坚持、坚持
若想深度掌握,就要让它跑起来
行动行动行动 自已动手 敲代码

算法九大块:

1.栈和队列 2.链表 3.二叉树 4.递归和动态规划 5.字符串 6.大数据和空间限制 7.位运算 8.数组和矩阵 9.其他

算法 栈和队列 MyStack1

package One01;

import java.util.Stack;

public class Mystack1 {
    private Stack<Integer> stackData;
    private Stack<Integer> stackMin;

    public Mystack1(){
        this.stackData= new Stack<Integer>();
        this.stackMin= new Stack<Integer>();
    }

    public int push(int newNum){
        if (this.stackMin.isEmpty()){
            this.stackMin.push(newNum);
        }else if (newNum<=this.getmin()){
            this.stackMin.push(newNum); 
                                        }
        this.stackData.push(newNum);
    }

    public int pop(){
        if (this.stackMin.isEmpty()){
            throw new RuntimeException("Your stack isempty.");
                                    }
        int value=this.stackData.pop();
        if (value == this.getmin()){
            this.stackMin.pop();
                                    }
        return value;
                    }

    public int getmin(){
        if (this.stackMin.isEmpty()){
            throw new RuntimeException("Your stack is empty.");
                    }
        return this.stackMin.peek();
    }

public static void main (String[] args){
    int newNum=5;


    Mystack1 Mystack = new Mystack1();
    int Num = Mystack.push(newNum);
    //if (Num<10)
        //Num++;
        //else return;

    System.out.print("The push is "+Num);


}

}

算法 栈和队列 MyStack2

package io.github.zjgwhcn;

import java.util.Stack;

public class MyStack2 {
	private Stack<Integer> stackData;
	private Stack<Integer> stackMin;
	
	public MyStack2(){
		this.stackData=new Stack<Integer>();
		this.stackMin=new  Stack<Integer>();
	}
	
	public int push(int newNum){
		if(this.stackMin.isEmpty()){
			this.stackMin.push(newNum);			
		}else if (newNum<this.getmin()){
			this.stackMin.push(newNum);
			}else{
			int newMin=this.stackMin.peek();
			this.stackMin.push(newNum);
				 }
				 return this.stackData.push(newNum);		
	}
	
	public int pop(){
		if(this.stackData.isEmpty()){
			throw new RuntimeException("Your stack is empty.");
			}
			this.stackMin.pop();
			return this.stackMin.pop();
	}
	
	public int getmin(){
		if(this.stackData.isEmpty()){
			throw new RuntimeException("Your stack is empty.");
		}
		return this.stackMin.peek();
	}

	public static void main (String[] args){
		int newNum=5;		
		MyStack2 Mystack= new MyStack2();
		int Num=Mystack.push(newNum);
		System.out.print("The push is"+Num);		
	}
}

要想深入学习

就必须突破技术壁垒

靠原始方法的速度很慢

如何快速突破技术壁垒?

需要我们每个人去思考,

寻找核心重点

抓核心,抓重点

将清醒的思考时间用在

突破核心突破重点突破难点

好钢用在刀刃上

每天坚持强化

早上@高效清醒时间突破难点

其他时间架构自己思想

持续坚持、坚持、坚持

要慢慢懂得

人生的时间有限

有限的时间长度

要想让自己快速成长进步

快速架构一个新的理论体系

需要我们认真思考

首先找提升动力源泉

找提升自己的紧迫感

当今世界知识量丰富

想进步的朋友会快速找到进步阶梯

所以别人的进步你未曾感受

别人艰辛你未曾体验

若不进步其实可能本身就是一种退步

蓦然发现的时候我们可能

已经和别人

和这个快速前进的社会

拉开了巨大距离!

可能已经晚矣!

起码努力使自己有一技之长

不断提升

可能在这个变幻的社会

才能不被淘汰

相信自己的不会白费的

此处不开花

总有开花

此处不留Y自有留Y处

即使永生不开花

起码你的心中要开出花来

不负此生

不负芳华

负你的即使是全世界

自己也要对自己褒奖

因为那是你选的的节奏

你的人生路线

mp.weixin.qq.com/s/5BIoys0-o…