方法1 回环法 讲listA & listB看成一个环 class Solution { public: ListNode *getIntersectionNode(ListNode *headA, ListNode *headB) { //回环法 讲listA & listB看成一个环 //e.g ...
分类:
编程语言 时间:
2021-05-24 10:28:54
阅读次数:
0
SpringBoot获取接口的所有实现类以及使用IOC实现最完美的简单工厂设计模式 本文连接地址:https://www.cnblogs.com/muphy/p/14770494.html SpringBoot获取接口的所有实现类 此方式主要是针对已经被IOC容器管理的实现类 例子: //创建Ani ...
分类:
编程语言 时间:
2021-05-24 09:54:33
阅读次数:
0
一、介绍 Math包含执行基本数字运算的方法,如基本指数、对数、平方根和三角函数。所提供的都是静态方法,可以直接调用。 二、abs public static int abs(int a) abs方法用来获取参数a的绝对值 例子 public class MathTest { public stat ...
分类:
编程语言 时间:
2021-05-24 09:39:38
阅读次数:
0
1.出度为0则为满足条件的节点,取所有出度为0的到queue中,之后循环减去这些队列中的出度,正反索引减少访问时间 class Solution { public: vector<int> eventualSafeNodes(vector<vector<int>>& graph) { vector< ...
分类:
其他好文 时间:
2021-05-24 09:15:19
阅读次数:
0
Markdown快速入门(typora) 1、代码块: // 代码块语法 ?```Java(语言类型) ?```shell 1.java代码块 public class HelloWorld { public static void main(String []args) { System.out. ...
分类:
其他好文 时间:
2021-05-24 08:54:58
阅读次数:
0
在最近项目中,由于netty服务地址从路由中心远程调用,在netty服务挂了之后,路由中心不能够实时监控到,仍然保留netty地址,这时需要使用netty服务时候 需要知道netty服务地址是真的可用,这里用socket方式来检测netty服务的远程端口是否可用 public static bool ...
分类:
编程语言 时间:
2021-05-24 08:48:07
阅读次数:
0
关键思路从后往前合并 class Solution { public void merge(int[] nums1, int m, int[] nums2, int n) { int idxm=m-1; int idxn=n-1; int sum=m+n-1; while(idxm>=0&&idxn ...
分类:
移动开发 时间:
2021-05-24 08:38:40
阅读次数:
0
命令模式 public interface Command { void execute(); } ? public class CommandA implements Command{ public void execute() { System.out.println("a执行了"); } } ...
分类:
其他好文 时间:
2021-05-24 08:31:58
阅读次数:
0
服务端 public static void main(String[] args) { ServerSocket serverSocket = null; Socket socket = null; InputStream inputStream = null; ByteArrayOutputSt ...
分类:
编程语言 时间:
2021-05-24 08:23:25
阅读次数:
0
单例模式 饿汉式 和 DCL懒汉式 饿汉式 package com.chao.single; //饿汉式单例 public class Hungry { //可能会浪费空间 private byte[] data1 = new byte[1024*1024]; private byte[] data ...
分类:
编程语言 时间:
2021-05-24 08:22:34
阅读次数:
0