LeetCode 725. Separate linked list / 326. 3 power / Sword finger Offer 62. The last remaining number in the circle (Joseph Ring problem)

725. Separate linked list One question per day on September 22, 2021 Title Description Given a linked list whose head node is root, write a function to separate the linked list into k consecutive parts. The length of each part should be as equal as possible: the length difference between any two parts cannot exceed 1, that is, some parts ma ...

Posted by jurdygeorge on Thu, 23 Sep 2021 15:01:05 +0200

Java notes: spring IoC

IoC container Container is a software environment that provides necessary support for the operation of a specific component. IoC refers to Inversion of Control Components assembled in IoC container need some kind of "injection" mechanism For example, a component needs a datasource. Instead of creating a datasource, it waits for the ...

Posted by Pryach on Thu, 23 Sep 2021 13:58:19 +0200

JVM01 - JVM Memory Structure

JVM01 - JVM Memory Structure 1.JVM Learning Route 2. Program counters Effect: The process from the java code in the computer to the execution is: source code to byte code, binary byte code to jvm instruction, handed to the interpreter, the interpreter to machine code, executed by the CPU. Just like this, the jvm instruction is execute ...

Posted by cody7 on Wed, 22 Sep 2021 23:40:12 +0200

Operating system 6 - producer consumer issues

Problem Description: One or more Producers place data in a buffer after productionA single consumer fetches data from the buffer for processingOnly one producer or consumer can access the buffer at any time Using semaphores to solve the producer consumer problem Problem analysis: Only one thread can operate the buffer at any time (mut ...

Posted by jfeather on Wed, 22 Sep 2021 20:23:59 +0200

java basic syntax -- object

object The difference between process oriented and object-oriented Process oriented: the main concerns are: the specific process of implementation, causality [development idea of integrated graphics card] Advantages: for programs with simple business logic, rapid development can be achieved, and the early investment cost is low. Disadvantage ...

Posted by carobee on Wed, 22 Sep 2021 17:47:07 +0200

Observer design pattern

preface Starting from this section, we will formally enter the study of concurrent programming design pattern. First, we will talk about the observer design pattern. We will start with the java design pattern, and then transition to the observer pattern of concurrent programming 1, What is the observer design pattern? About what is t ...

Posted by whitelion on Wed, 22 Sep 2021 16:10:37 +0200

Mybatis study notes

brief introduction What is Mybatis? MyBatis is an excellent persistence layer framework.It supports custom SQL, stored procedures, and advanced mapping.MyBatis eliminates almost all JDBC code and the work of setting parameters and obtaining result sets.MyBatis can configure and map primitive types, interfaces and Java POJO s (Plain Old Java O ...

Posted by ClyssaN on Wed, 22 Sep 2021 15:44:35 +0200

Do you know the common scenarios of redis?

1. Cache String type For example, hot data cache (such as reports and star cheating), object cache and full page cache can improve the access data of hot data. 2. Data sharing distributed String type, because Redis is a distributed independent service that can be shared among multiple applications For example: distributed Session <depe ...

Posted by KoshNaranek on Wed, 22 Sep 2021 14:12:56 +0200

Beginner's Day 88 - > is Java passed by reference?

To understand this problem, we should understand two concepts: what is passing by value and what is passing by reference call by value: refers to copying and passing the value of the actual parameter to the function when calling the function, so that if the parameter is modified in the function, the actual parameter will not be affected call ...

Posted by douceur on Wed, 22 Sep 2021 04:07:55 +0200

How to build generic arrays-- JAVA programming ideas 54

Today, let's talk about how to create a generic array? Some people may say that this is not simple. Just T[] array = new T[size]? Unfortunately, the compiler will prompt that generics cannot be instantiated directly. Let's change our thinking. First create an Object array and then convert it to the corresponding generic. Is that ok? public ...

Posted by anindya23 on Tue, 21 Sep 2021 23:10:00 +0200