Sword finger offer week 5 incomplete

Sword finger offer week 5 incomplete 73. Two numbers that only appear once in the array Except for two numbers in an integer array, other numbers appear twice. Please write a program to find out the two numbers that only appear once. You can assume that these two numbers must exist. Example Input: ...

Posted by pixy on Fri, 19 Jun 2020 21:35:32 -0700

Design and Implementation of Linux Kernel Chapter 6 Kernel Data Structure

Article Directory 1. Chain List Chain lists in the Linux kernel are special list_entry, container_of and offsetof macros An example illustrates `offsetof` and `container_of`Macro Operations on linked lists 1. Create a list of chains 2. Add Node to Chain List 3. Delete Nodes 4. Move merge nodes 5. D ...

Posted by Seol on Fri, 19 Jun 2020 18:25:09 -0700

You could have written less if else

“… He thinks that Blub language is enough, and then his thinking has been assimilated by Blub language "- Paul Graham, hackers and painters > preface I don't like the shuttle if/else statement in business code. It's complex and bloated. At least in terms of aesthetic feeling, swit ...

Posted by webtech123 on Fri, 19 Jun 2020 05:21:57 -0700

Hibernate Validator - object grouping validation (probably the most comprehensive explanation in the old world)

Then I broke it down last time. I didn't see the children's shoes in the first chapter Click here Play back the content of the previous chapter Entity class @Data @AgeSalaryType public class Student { private Long id; @NotBlank(message = "Name cannot be empty") private String name; @ ...

Posted by apol on Fri, 19 Jun 2020 04:52:25 -0700

JavaSE learning notes - Collections, Arrays, other classes

Java learning notes Tools Collections Collection and Collections method Example Arrays method Example analysis Others Date class Calendar Class practice Math class Link: jdk13_API. Tools Collections Collection and Collections The difference between Collection and Collections: Collecti ...

Posted by JackOfBlades on Fri, 19 Jun 2020 03:57:27 -0700

Redis based distributed lock implementation

From 1, Distributed lock overview In the multithreaded environment, in order to ensure that a code block can only be accessed by one thread at a time, we can generally use the synchronized syntax and ReetrantLock in Java to ensure that this is actually the way of local locking. But now companies are a ...

Posted by hillbilly928 on Fri, 19 Jun 2020 00:04:48 -0700

An article gives you a thorough understanding of the implementation of HashMap without worrying about being bullied.

Article catalog HashMap preface What is a red black tree Discoloration rotate Sinistral Dextral brief introduction Basic elements of HashMap Node Construction method HashMap() HashMap(int initialCapacity) HashMap(Map<? extends K, ? extends V> m) Add method put Get method get Expand resize ...

Posted by NoorAdiga on Thu, 18 Jun 2020 23:25:45 -0700

Python sorting algorithm

Python sorting algorithm All the following sorting methods will use the swap function to exchange the positions in the two lists. The code is as follows: def swap(lyst,i,j): temp = lyst[i] lyst[i]=lyst[j] lyst[j]=temp 1. Select Sorting: Principle (integer list sorting from small to larg ...

Posted by efegue on Thu, 18 Jun 2020 22:36:23 -0700

Python code to realize airplane battle

Article catalog Classic aircraft battle 1, Game settings 2, Our plane 3, Enemy aircraft 4, To fire a bullet 5, Issue supply package 6, Main module Classic aircraft battle The source code and material materials (pictures and audio) can be downloaded from the following github: Source code of ai ...

Posted by scottb1 on Thu, 18 Jun 2020 21:57:55 -0700

Java array sorting I [cloud map smart link]

Array concept: Array is a container with fixed data length to ensure the consistency of data types of multiple data. To declare an array is to draw a series of continuous spaces in the memory space Array name represents the first address of continuous space All elements of the array can be accessed successively through the first address   1, Th ...

Posted by heals1ic on Thu, 18 Jun 2020 03:16:17 -0700