zoukankan      html  css  js  c++  java
  • day25(025-多线程(下)&GUI)

    线程状态图

    ###25.01_多线程(单例设计模式)(掌握)

    • 单例设计模式:保证类在内存中只有一个对象。

    • 如何保证类在内存中只有一个对象呢?

      • (1)控制类的创建,不让其他类来创建本类的对象。private

      • (2)在本类中定义一个本类的对象。Singleton s;

      • (3)提供公共的访问方式。 public static Singleton getInstance(){return s}

    • 单例写法两种:

      • (1)饿汉式 开发用这种方式。

      • package com.heima.thread;
        
        public class test {
            /**
             * @param args
             * * 单例设计模式:保证类在内存中只有一个对象。
             */
            public static void main(String[] args) {
                 
                
                Singleton s1 = Singleton.getInstance();
                Singleton s2 = Singleton.getInstance();
                
                System.out.println(s1 == s2);
            }
            
            
        }
        
        
        /**
         * 饿汉式
         *
         */ 
         class Singleton {
            //1,私有构造方法,其他类不能访问该构造方法了
            private Singleton(){
                
            }
            //2,创建本类对象
            private static Singleton s = new Singleton();
            //3,对外提供公共的访问方法
            public static Singleton getInstance() {                //获取实例
                return s;
            }
        }
        View Code 单例模式-饿汉式
      • (2)懒汉式 面试写这种方式。多线程的问题? 
      • //懒汉式,单例的延迟加载模式,有多线程访问的同步问题,实际工程一般不采用。
      • /*
         * 懒汉式,单例的延迟加载模式
         */
        class Singleton {
            //1,私有构造方法,其他类不能访问该构造方法了
            private Singleton(){
                
            }
            //2,声明一个引用
            private static Singleton s ;
            //3,对外提供公共的访问方法
            public static Singleton getInstance() {            //获取实例
                if(s == null) {
                    //线程1等待,线程2等待
                    s = new Singleton();
                }
                
                return s;
            }
        }
        View Code 单例模式-懒汉式

        /*
        * 饿汉式和懒汉式的区别
        * 1,饿汉式是空间换时间,懒汉式是时间换空间
        * 2,在多线程访问时,饿汉式不会创建多个对象,而懒汉式有可能会创建多个对象
        */

     (3)第三种格式

    class Singleton {
        //1,私有构造方法,其他类不能访问该构造方法了
        private Singleton(){
            
        }
        //2,声明一个引用
        public static final Singleton s = new Singleton();
        
    }
    View Code

    ###25.03_多线程(Timer)(掌握)

    • Timer类:计时器

     

    package com.heima.thread;
    
    import java.util.Date;
    import java.util.Timer;
    import java.util.TimerTask;
    
    public class Demo3_Timer {
    
        /**
         * @param args
         * @throws InterruptedException 
         */
        public static void main(String[] args) throws InterruptedException {
            Timer t = new Timer();
            //在指定时间安排指定任务
            //第一个参数,是安排的任务,第二个参数是执行的时间,第三个参数是过多长时间再重复执行
            t.schedule(new MyTimerTask(), new Date(120, 1, 10, 15, 51, 50),3000);    
            
            while(true) {
                Thread.sleep(1000);
                System.out.println(new Date());
            }
        }
    
    }
    
    class MyTimerTask extends TimerTask {
    
        @Override
        public void run() {
            System.out.println("起床背英语单词");
        }
    }
    View Code

    ###25.04_多线程(两个线程间的通信)(掌握)

    • 1.什么时候需要通信

      • 多个线程并发执行时, 在默认情况下CPU是随机切换线程的

      • 如果我们希望他们有规律的执行, 就可以使用通信, 例如每个线程执行一次打印

    • 2.怎么通信

      • 如果希望线程等待, 就调用wait()

      • 如果希望唤醒等待的线程, 就调用notify();

      • 这两个方法必须在同步代码中执行, 并且使用同步锁对象来调用

    Demo1_Notify

    package com.heima.thread2;
    
    
    public class Demo1_Notify {
    
        /**
         * @param args
         * 等待唤醒机制
         */
        public static void main(String[] args) {
            final Printer p = new Printer();
            
            new Thread() {
                public void run() {
                    while(true) {
                        try {
                            p.print1();
                        } catch (InterruptedException e) {
                            
                            e.printStackTrace();
                        }
                    }
                }
            }.start();
            
            new Thread() {
                public void run() {
                    while(true) {
                        try {
                            p.print2();
                        } catch (InterruptedException e) {
                            
                            e.printStackTrace();
                        }
                    }
                }
            }.start();
        }
    
    }
    
    //等待唤醒机制
    class Printer {
        private int flag = 1;
        public void print1() throws InterruptedException {                            
            synchronized(this) {
                if(flag != 1) {
                    this.wait();                    //当前线程等待
                }
                System.out.print("黑");
                System.out.print("马");
                System.out.print("程");
                System.out.print("序");
                System.out.print("员");
                System.out.print("
    ");
                flag = 2;
                Thread.sleep(1000); //sleep不释放锁
                this.notify();                        //随机唤醒单个等待的线程
            }
        }
        
        public void print2() throws InterruptedException {
            synchronized(this) {
                if(flag != 2) {
                    this.wait();
                }
                System.out.print("传");
                System.out.print("智");
                System.out.print("播");
                System.out.print("客");
                System.out.print("
    ");
                flag = 1;
                Thread.sleep(1000); //sleep不释放锁
                this.notify();
            }
        }
    }
    View Code

    Demo2_NotifyAll

    package com.heima.thread2;
    
    public class Demo2_NotifyAll {
    
        /**
         * @param args
         */
        public static void main(String[] args) {
            final Printer2 p = new Printer2();
            new Thread() {
                public void run() {
                    while(true) {
                        try {
                            p.print1();
                        } catch (InterruptedException e) {
                            
                            e.printStackTrace();
                        }
                    }
                }
            }.start();
            
            new Thread() {
                public void run() {
                    while(true) {
                        try {
                            p.print2();
                        } catch (InterruptedException e) {
                            
                            e.printStackTrace();
                        }
                    }
                }
            }.start();
            
            new Thread() {
                public void run() {
                    while(true) {
                        try {
                            p.print3();
                        } catch (InterruptedException e) {
                            
                            e.printStackTrace();
                        }
                    }
                }
            }.start();
        }
    
    }
    /*1,在同步代码块中,用哪个对象锁,就用哪个对象调用wait方法
     * 2,为什么wait方法和notify方法定义在Object这类中?
     *     因为锁对象可以是任意对象,Object是所有的类的基类,所以wait方法和notify方法需要定义在Object这个类中
     * 3,sleep方法和wait方法的区别?
     * a,sleep方法必须传入参数,参数就是时间,时间到了自动醒来
     *   wait方法可以传入参数也可以不传入参数,传入参数就是在参数的时间结束后等待,不传入参数就是直接等待
     * b,sleep方法在同步函数或同步代码块中,不释放锁,睡着了也抱着锁睡
     *     wait方法在同步函数或者同步代码块中,释放锁
     */ 
    class Printer2 {
        private int flag = 1;
        public void print1() throws InterruptedException {                            
            synchronized(this) {
                while(flag != 1) {
                    this.wait();                    //当前线程等待
                }
                System.out.print("黑");
                System.out.print("马");
                System.out.print("程");
                System.out.print("序");
                System.out.print("员");
                System.out.print("
    ");
                flag = 2;
                //this.notify();                        //随机唤醒单个等待的线程
                this.notifyAll();
            }
        }
        
        public void print2() throws InterruptedException {
            synchronized(this) {
                while(flag != 2) {
                    this.wait();                    //线程2在此等待
                }
                System.out.print("传");
                System.out.print("智");
                System.out.print("播");
                System.out.print("客");
                System.out.print("
    ");
                flag = 3;
                //this.notify();
                this.notifyAll();
            }
        }
        
        public void print3() throws InterruptedException {
            synchronized(this) {
                while(flag != 3) {
                    this.wait();                        //线程3在此等待,if语句是在哪里等待,就在哪里起来
                                                        //while循环是循环判断,每次都会判断标记
                }
                System.out.print("i");
                System.out.print("t");
                System.out.print("h");
                System.out.print("e");
                System.out.print("i");
                System.out.print("m");
                System.out.print("a");
                System.out.print("
    ");
                flag = 1;
                //this.notify();
                this.notifyAll();
            }
        }
    }
    View Code

    ###25.06_多线程(JDK1.5的新特性互斥锁)(掌握)

    • 1.同步

      • 使用ReentrantLock类的lock()和unlock()方法进行同步

    • 2.通信

      • 使用ReentrantLock类的newCondition()方法可以获取Condition对象

      • 需要等待的时候使用Condition的await()方法, 唤醒的时候用signal()方法

      • 不同的线程使用不同的Condition, 这样就能区分唤醒的时候找哪个线程了

    Demo3_ReentrantLock

    package com.heima.thread2;
    
    import java.util.concurrent.locks.Condition;
    import java.util.concurrent.locks.ReentrantLock;
    
    public class Demo3_ReentrantLock {
    
        /**
         * @param args
         */
        public static void main(String[] args) {
            final Printer3 p = new Printer3();
            
            new Thread() {
                public void run() {
                    while(true) {
                        try {
                            p.print1();
                        } catch (InterruptedException e) {
                            
                            e.printStackTrace();
                        }
                    }
                }
            }.start();
            
            new Thread() {
                public void run() {
                    while(true) {
                        try {
                            p.print2();
                        } catch (InterruptedException e) {
                            
                            e.printStackTrace();
                        }
                    }
                }
            }.start();
            
            new Thread() {
                public void run() {
                    while(true) {
                        try {
                            p.print3();
                        } catch (InterruptedException e) {
                            
                            e.printStackTrace();
                        }
                    }
                }
            }.start();
        }
    
    }
    
    class Printer3 {
        private ReentrantLock r = new ReentrantLock();
        private Condition c1 = r.newCondition();
        private Condition c2 = r.newCondition();
        private Condition c3 = r.newCondition();
        
        private int flag = 1;
        public void print1() throws InterruptedException {                            
            r.lock();                                //获取锁
                if(flag != 1) {
                    c1.await();
                }
                System.out.print("黑");
                System.out.print("马");
                System.out.print("程");
                System.out.print("序");
                System.out.print("员");
                System.out.print("
    ");
                flag = 2;
                //this.notify();                        //随机唤醒单个等待的线程
                c2.signal();
            r.unlock();                                //释放锁
        }
        
        public void print2() throws InterruptedException {
            r.lock();
                if(flag != 2) {
                    c2.await();
                }
                System.out.print("传");
                System.out.print("智");
                System.out.print("播");
                System.out.print("客");
                System.out.print("
    ");
                flag = 3;
                //this.notify();
                c3.signal();
            r.unlock();
        }
        
        public void print3() throws InterruptedException {
            r.lock();
                if(flag != 3) {
                    c3.await();
                }
                System.out.print("i");
                System.out.print("t");
                System.out.print("h");
                System.out.print("e");
                System.out.print("i");
                System.out.print("m");
                System.out.print("a");
                System.out.print("
    ");
                flag = 1;
                c1.signal();
            r.unlock();
        }
    }
    View Code

    ###25.07_多线程(线程组的概述和使用)(了解)

    • A:线程组概述

      • Java中使用ThreadGroup来表示线程组,它可以对一批线程进行分类管理,Java允许程序直接对线程组进行控制。

      • 默认情况下,所有的线程都属于主线程组。

        • public final ThreadGroup getThreadGroup()//通过线程对象获取他所属于的组

        • public final String getName()//通过线程组对象获取他组的名字

      • 我们也可以给线程设置分组

        • 1,ThreadGroup(String name) 创建线程组对象并给其赋值名字

        • 2,创建线程对象

        • 3,Thread(ThreadGroup?group, Runnable?target, String?name)

        • 4,设置整组的优先级或者守护线程

    Demo4_ThreadGroup

    package com.heima.thread2;
    
    public class Demo4_ThreadGroup {
    
        /**
         * @param args
         * ThreadGroup
         */
        public static void main(String[] args) {
            //demo1();
            ThreadGroup tg = new ThreadGroup("我是一个新的线程组");        //创建新的线程组
            MyRunnable mr = new MyRunnable();                        //创建Runnable的子类对象
            
            Thread t1 = new Thread(tg, mr, "张三");                    //将线程t1放在组中
            Thread t2 = new Thread(tg, mr, "李四");                    //将线程t2放在组中
            
            System.out.println(t1.getThreadGroup().getName());        //获取组名
            System.out.println(t2.getThreadGroup().getName());
            
            tg.setDaemon(true);
        }
    
        public static void demo1() {
            MyRunnable mr = new MyRunnable();
            Thread t1 = new Thread(mr, "张三");
            Thread t2 = new Thread(mr, "李四");
            
            ThreadGroup tg1 = t1.getThreadGroup();
            ThreadGroup tg2 = t2.getThreadGroup();
            
            System.out.println(tg1.getName());                //默认的是主线程
            System.out.println(tg2.getName());
        }
    
    }
    
    class MyRunnable implements Runnable {
    
        @Override
        public void run() {
            for(int i = 0; i < 1000; i++) {
                System.out.println(Thread.currentThread().getName() + "...." + i);
            }
        }
        
    }
    View Code

     ###25.08_多线程(线程的五种状态)(掌握)

    新建,就绪,运行,阻塞,死亡

    public class Demo5_Executors {
    
        /**
         * public static ExecutorService newFixedThreadPool(int nThreads)
         * public static ExecutorService newSingleThreadExecutor()
         */
        public static void main(String[] args) {
            ExecutorService pool = Executors.newFixedThreadPool(2);//创建线程池
            pool.submit(new MyRunnable());                //将线程放进池子里并执行
            pool.submit(new MyRunnable());
            
            pool.shutdown();                            //关闭线程池
        }
    
    }

    ###25.09_多线程(线程池的概述和使用)(了解)

    A:线程池概述

    • 程序启动一个新线程成本是比较高的,因为它涉及到要与操作系统进行交互。而使用线程池可以很好的提高性能,尤其是当程序中要创建大量生存期很短的线程时,更应该考虑使用线程池。线程池里的每一个线程代码结束后,并不会死亡,而是再次回到线程池中成为空闲状态,等待下一个对象来使用。从JDK5开始,Java内置支持线程池。

    B:内置线程池的使用概述

    • JDK5新增了一个Executors工厂类来产生线程池,有如下几个方法

      • public static ExecutorService newFixedThreadPool(int nThreads)

      • public static ExecutorService newSingleThreadExecutor()

      • 这些方法的返回值是ExecutorService对象,该对象表示一个线程池,可以执行Runnable对象或者Callable对象代表的线程。它提供了如下方法

      • Future<?> submit(Runnable task)

      • <T> Future<T> submit(Callable<T> task)

    ###25.10_多线程(多线程程序实现的方式3)(了解)

    • 提交的是Callable

    • 多线程程序实现的方式3的好处

      • 好处:

        • 可以有返回值

        • 可以抛出异常

    Demo6_Callable

    package com.heima.thread2;
    
    import java.util.concurrent.Callable;
    import java.util.concurrent.ExecutionException;
    import java.util.concurrent.ExecutorService;
    import java.util.concurrent.Executors;
    import java.util.concurrent.Future;
    
    public class Demo6_Callable {
    
        /**
         * @param args
         * @throws ExecutionException 
         * @throws InterruptedException 
         */
        public static void main(String[] args) throws InterruptedException, ExecutionException {
            ExecutorService pool = Executors.newFixedThreadPool(2);//创建线程池
            Future<Integer> f1 = pool.submit(new MyCallable(100));                //将线程放进池子里并执行
            Future<Integer> f2 = pool.submit(new MyCallable(50));
            
            System.out.println(f1.get());
            System.out.println(f2.get());
            
            pool.shutdown();                            //关闭线程池
        }
    
    }
    
    class MyCallable implements Callable<Integer> {
        private int num;
        public MyCallable(int num) {
            this.num = num;
        }
        @Override
        public Integer call() throws Exception {
            int sum = 0;
            for(int i = 1; i <= num; i++) {
                sum += i;
            }
            
            return sum;
        }
        
    }
    View Code

    ###25.11_设计模式(简单工厂模式概述和使用)(了解)

    • A:简单工厂模式概述

      • 又叫静态工厂方法模式,它定义一个具体的工厂类负责创建一些类的实例

    • B:优点

      • 客户端不需要在负责对象的创建,从而明确了各个类的职责

    • C:缺点

      • 这个静态工厂类负责所有对象的创建,如果有新的对象增加,或者某些对象的创建方式不同,就需要不断的修改工厂类,不利于后期的维护

    Animal

    package com.heima.简单工厂;
    
    public abstract class Animal {
        public abstract void eat();
    }
    View Code

    Cat

    package com.heima.简单工厂;
    
    public class Cat extends Animal {
    
        @Override
        public void eat() {
            System.out.println("猫吃鱼");
        }
    
    }
    View Code

    Dog

    package com.heima.简单工厂;
    
    public class Dog extends Animal {
    
        @Override
        public void eat() {
            System.out.println("狗吃肉");
        }
    
    }
    View Code

    AnimalFactory

    package com.heima.简单工厂;
    
    public class AnimalFactory {
        /*public static Dog createDog() {
            return new Dog();
        }
        
        public static Cat createCat() {
            return new Cat();
        }*/
        
        //发现方法会定义很多,复用性太差
        //改进
        public static Animal createAnimal(String name) {
            if("dog".equals(name)) {
                return new Dog();
            }else if("cat".equals(name)) {
                return new Cat();
            }else {
                return null;
            }
        }
    }
    View Code

    Test

    package com.heima.简单工厂;
    
    public class Test {
    
        /**
         * @param args
         */
        public static void main(String[] args) {
            //Dog d = AnimalFactory.createDog();
            
            Dog d = (Dog) AnimalFactory.createAnimal("dog");
            d.eat();
            
            Cat c = (Cat) AnimalFactory.createAnimal("cat");
            c.eat();
        }
    
    }
    View Code

    ###25.12_设计模式(工厂方法模式的概述和使用)(了解)

    Animal

    package com.heima.工厂方法;
    
    public abstract class Animal {
        public abstract void eat();
    }
    View Code

    Cat

    package com.heima.工厂方法;
    
    public class Cat extends Animal {
    
        @Override
        public void eat() {
            System.out.println("猫吃鱼");
        }
    
    }
    View Code

    Dog

    package com.heima.工厂方法;
    
    public class Dog extends Animal {
    
        @Override
        public void eat() {
            System.out.println("狗吃肉");
        }
    
    }
    View Code

    Factory接口

    package com.heima.工厂方法;
    
    public interface Factory {
        public Animal createAnimal();
    }
    View Code

    CatFactory

    package com.heima.工厂方法;
    
    public class CatFactory implements Factory {
    
        @Override
        public Animal createAnimal() {
    
            return new Cat();
        }
    
    }
    View Code

    DogFactory

    package com.heima.工厂方法;
    
    public class DogFactory implements Factory {
    
        @Override
        public Animal createAnimal() {
    
            return new Dog();
        }
    
    }
    View Code

    Test

    package com.heima.工厂方法;
    
    public class Test {
    
        /**
         * @param args
         */
        public static void main(String[] args) {
            DogFactory df = new DogFactory();
            Dog d = (Dog) df.createAnimal();
            d.eat();
        }
    
    }
    View Code

    ###25.19_设计模式(适配器设计模式)(掌握)

    • a.什么是适配器

      • 在使用监听器的时候, 需要定义一个类事件监听器接口.

      • 通常接口中有多个方法, 而程序中不一定所有的都用到, 但又必须重写, 这很繁琐.

      • 适配器简化了这些操作, 我们定义监听器时只要继承适配器, 然后重写需要的方法即可.

    • b.适配器原理

      • 适配器就是一个类, 实现了监听器接口, 所有抽象方法都重写了, 但是方法全是空的

      • 适配器类需要定义成抽象的,因为创建该类对象,调用空方法是没有意义的

      • 目的就是为了简化程序员的操作, 定义监听器时继承适配器, 只重写需要的方法就可以了

    package com.heima.适配器;
    
    public class Demo1_Adapter {
    
        /**
         * @param args
         * 适配器设计模式
         * 鲁智深
         */
        public static void main(String[] args) {
            
        }
    
    }
    
    interface 和尚 {
        public void 打坐();
        public void 念经();
        public void 撞钟();
        public void 习武();
    }
    
    //声明成抽象的原因是,不想让其他类创建本类对象,因为创建也没有意义,方法都是空的
    abstract class 天罡星 implements 和尚 {        
    
        @Override
        public void 打坐() {
        }
    
        @Override
        public void 念经() {
        }
    
        @Override
        public void 撞钟() {
        }
    
        @Override
        public void 习武() {
        }
        
    }
    
    class 鲁智深 extends 天罡星 {
        public void 习武() {
            System.out.println("倒拔垂杨柳");
            System.out.println("拳打镇关西");
            System.out.println("大闹野猪林");
            System.out.println("......");
        }
    }
    View Code

    ###25.20_GUI(需要知道的)

    • 事件处理

      • 事件: 用户的一个操作

      • 事件源: 被操作的组件

      • 监听器: 一个自定义类的对象, 实现了监听器接口, 包含事件处理方法,把监听器添加在事件源上, 当事件发生的时候虚拟机就会自动调用监听器中的事件处理方法。

    用自己的语言描述下列问题,要尽量详细,不要过于依赖笔记,自己能想到的也算(实在不会整理背标准答案,明天课前提问)
    1、单例设计模式,适配器设计模式
    2、饿汉式和懒汉式的区别
    4、Timer类是干嘛的
    5、wait和sleep的区别
    6、线程的生命周期(五中状态的切换流程)

    用自己的语言描述下列问题,要尽量详细,不要过于依赖笔记,自己能想到的也算
    1、单例设计模式,适配器设计模式
        单利设计模式:    
            在java中,单例模式是指为了保证类在内存中只有一个对象,而形成的一种固有的代码模式!
        适配器设计模式:
            在java中,适配器设计模式是指为了监视某些行为,但是对于每种监听到的行为又有不同的处理,为了能够让监听者自行来处理监听到指定行为后,要做的后续操作,而形成的一种固有的代码模式!
    
        适配器标准课上答案:
            * a.什么是适配器
                * 在使用监听器的时候, 需要定义一个类事件监听器接口.
                * 通常接口中有多个方法, 而程序中不一定所有的都用到, 但又必须重写, 这很繁琐.
                * 适配器简化了这些操作, 我们定义监听器时只要继承适配器, 然后重写需要的方法即可.
            * b.适配器原理
                * 适配器就是一个类, 实现了监听器接口, 所有抽象方法都重写了, 但是方法全是空的.
                * 适配器类需要定义成抽象的,因为创建该类对象,调用空方法是没有意义的
                * 目的就是为了简化程序员的操作, 定义监听器时继承适配器, 只重写需要的方法就可以了.
    2、饿汉式和懒汉式的区别
        使用场合:
            饿汉式:    开发用
            懒汉式:    面使用,开发一般不用
        思想:
            饿汉式:    类一加载就生成对象。
            懒汉式:    在调用获取对象的方法的时候生成。
        实用性:
            饿汉式:    安全,效率高。相对懒汉式会在未使用之前就占用内存。
            懒汉式:    存在线程安全漏洞,可以利用同步解决,但是效率会变低。内存方面符合了编程中的延迟加载思想。(在面试中面试官会比较希望答出这一点)
    3、Timer类是干嘛的
        Timer类是计时器。
        一般的使用过程是在Timer类的schedule()方法中传入两个参数,一个TimerTask的子类对象,在这个子类对象中规定了计时结束的操作,另一个java.util.Date类的对象,其参数指定了计时的开始时间和循环周期,
    4、wait和sleep的区别
        sleep方法:定义在Thread类中,让线程在指定时间内处于休眠状态,超时后继续向下执行,休眠的线程不会释放锁资源。
        wait方法 :定义在Object类中,让以当前对象为监视器的线程处于阻塞状态,不可获取执行权,在得到notify或者notifyAll的通知后再继续抢夺执行权。等待的线程会释放锁资源。
    5、线程的生命周期(五中状态的切换流程)
        线程分为5个生命周期,新建,就绪,运行,阻塞,死亡
        其中:
            新建代表线程在内存中创建,对应start方法。
            就绪代表线程拥有抢夺执行权的资格,如果抢到就会执行线程中的内容
            运行代码线程中的内容正在执行。
                a:若被抢走执行权,回到就绪状态
                b:若执行ssleep、wait等方法,会进入阻塞状态。
            阻塞代表线程被强制不可进入就绪状态,对于非就绪状态的线程是没有机会抢夺执行权,也就更不可能进入运行状态了。
            死亡代表线程运行结束,也可能是被强制结束,一般不建议使用。
    View Code
    部分内容来自于学习编程期间收集于网络的免费分享资源和工作后购买的付费内容。
  • 相关阅读:
    python项目---数据可视化(02)
    python项目---数据可视化(01)
    sort 快排解决百万级的排序
    插入排序专题 直接插入 折半 希尔shell
    人见人爱A^B
    内部收益率
    台球碰撞
    杭电 1061 Rightmost Digit计算N^N次方的最后一位
    数字整除
    循环 未理解
  • 原文地址:https://www.cnblogs.com/MarlonKang/p/12290824.html
Copyright © 2011-2022 走看看