Algorithm: tree structure

tree Definition and related concepts of tree Start with the linked list and diagram Linked list In the previous content, we learned the basic data structure of linked list. Single linked list is one of them. The structure form is as follows: # Definition for the singly-linked list. Class ListNod: def __init__(self, val=0, next=Non ...

Added by iHack on Tue, 01 Mar 2022 16:07:37 +0200

VuePress blog optimization opens Algolia full text search

prefacestay "A blog with VuePress + Github Pages" In, we used VuePress to build a blog. The final effect is as follows: TypeScript Chinese document. Because VuePress's built-in search will only build the search index for the title, h2, h3 and tags of the page. If you need full-text search, you can use Algolia search. This article talk ...

Added by roice on Tue, 01 Mar 2022 15:25:33 +0200

Deep understanding of redis -- Discussion on update strategy of cache double write consistency

1.Redis cache double write consistency2. Several update strategies for database and cache consistency2.1 update the database first and then the cache2.2 delete the cache first and then update the database2.3 update the database first and then delete the cache2.4 update the cache first, and then update the database3. canal of the implementation ...

Added by Fribbles on Tue, 01 Mar 2022 15:23:52 +0200

Is the if instruction in 09 location in nginx the devil

This article is an official article on nginx If is Evil... when used in location context Translation and understanding. 1. Introduction There is a problem with the if instruction in the location block. In some cases, the if instruction will not work as we expected, but may develop in a completely different direction and even cause errors. T ...

Added by irwa82 on Tue, 01 Mar 2022 15:17:22 +0200

Learn more about and use ThreadLocal

Learn more about and use ThreadLocalWhat is ThreadLocal This class provides thread-local variables. These variables differ from their normal counterparts in that each thread that accesses one (via its get or set method) has its own, independently initialized copy of the variable. ThreadLocal instances are typically private static fields in clas ...

Added by GundamSV7 on Tue, 01 Mar 2022 15:15:20 +0200

Create a comfortable writing environment (Hexo)

Create a comfortable writing environment (Hexo) use Hexo Toss and run the static website for a long time. I haven't sorted out the construction experience in this regard. Recently, I'll write about the construction process of this website and the way of updating articles. Well, the main thing is to record the white whoring posture of various re ...

Added by jigen7 on Tue, 01 Mar 2022 15:14:21 +0200

RecyclerView usage record

RecyclerView usage recordAs the function & requirements of the company's own app client become more and more complex, the layout of some pages becomes more and more complex. At the suggestion of former colleagues, use RecyclerView to implement it.demandThe general requirements are shown in the figure below. The table layout needs to be disp ...

Added by drunkencelt on Tue, 01 Mar 2022 14:55:35 +0200

[layering diagram shortest circuit] [shortest circuit deformation] communication line AcWing340

There are N communication base stations in the suburbs, P two-way cables, and the i cable connects the base stations Ai and Bi. In particular, base station 1 is the main station of the communication company, and base station N is located in a farm. Now, the farmer wants to upgrade the communication line, and upgrading the i Cable Costs Li. T ...

Added by Chief on Tue, 01 Mar 2022 14:26:31 +0200

park() and unpark() functions of LockSupport class and case analysis

Official interpretation: LockSupport is the basic thread blocking primitive used to create locks and other synchronization classes; LockSupport class uses a concept called permission to block and wake up threads. Each thread has a permission; permit has only two values: 1 and zero. The default value is zero; You can think of a license as a ...

Added by elecktricity on Tue, 01 Mar 2022 14:19:31 +0200

Unpredictable beauty of Python Random modules

1 . concept 1.1 true and pseudo-random numbers Most computer languages provide API s for generating random numbers, which are called random number generators. Computers can use random numbers to simulate various random probability problems in the real world. The programming language without random generator is not a "good language&q ...

Added by solus on Tue, 01 Mar 2022 14:17:05 +0200