TreeMap and TreeSet are Maps and Sets implemented in Java using a binary search tree

First: ConceptsA binary search tree, also known as a binary sorting tree, is either an empty tree** or a binary tree with the following properties:If its left subtree is not empty, the values of all nodes in the left subtree are less than those of the root node.If its right subtree is not empty, the values of all nodes in the right subtree are ...

Posted by jrws on Sat, 29 Feb 2020 09:28:46 -0800

Proficient in awk series (18): if, while, switch, for statements of awk process control

Go back to: Linux series Shell series Awk series Process control statement Note: statement blocks in awk have no scope and are global variables. if (condition) statement [ else statement ] expr1?expr2:expr3 while (condition) statement do statement while (condition) for (expr1; expr2; expr3) statement for (var in array) statement break co ...

Posted by rex9990 on Fri, 28 Feb 2020 21:04:16 -0800

Proficient in awk series (18): if, while, switch, for statements of awk process control

Go back to: Linux series Shell series Awk series Process control statement Note: statement blocks in awk have no scope and are global variables. if (condition) statement [ else statement ] expr1?expr2:expr3 while (condition) statement do statement while (condition) for (expr1; expr2; expr3) statement for (var in array) statement break co ...

Posted by scuba on Fri, 28 Feb 2020 20:53:46 -0800

Review of nine intelligent optimization algorithms: annealing algorithm

Review purpose: Better understand the basic model idea and principle implementation of the annealing algorithm, and further optimize the previous implementation code On the basis of the original annealing algorithm, the possibility of "dead ash reburning" is introduced, which reduces the ...

Posted by Floodboy on Fri, 28 Feb 2020 04:59:57 -0800

python foundation, dictionary, collection, control statement

First, the dictionary. 1. Definition: the dictionary is an unordered variable sequence of key value pairs, which is divided into key object and value object. Where, the key object is immutable data (integer, floating-point number, string, tuple), and the key is not repeatable. Reminder: in the list, we ...

Posted by qo2o on Fri, 28 Feb 2020 04:43:04 -0800

Chain of responsibility pattern

To avoid the coupling of requester and sender, multiple objects have the chance to receive the request. These objects form a chain, and pass the request along the chain until the request is processed. Case study: The OA system of Sunny software company needs to provide a receipt approval module: if th ...

Posted by andz on Thu, 27 Feb 2020 23:41:54 -0800

How to implement the complete INI file reading and writing class

Author: Magic fudge Date: February 27, 2020 Introduction ************************************* The. ini file is an abbreviation of the Initialization File, which is the configuration file. yes windows System configuration file The storage format used. It is easy to use, and has similar functions with the key value of the registry. Various appli ...

Posted by chalexan on Thu, 27 Feb 2020 21:32:58 -0800

Sword point offer (python) -- tree

01 reconstruction of binary tree Title Description Enter the results of the preorder traversal and inorder traversal of a binary tree, and rebuild the binary tree. It is assumed that the results of the input preorder traversal and preorder traversal do not contain duplicate numbers. For example, if th ...

Posted by eoghain on Thu, 27 Feb 2020 00:04:44 -0800

Multithreading: thread creation and thread safety

Article directory Program, process, thread Create thread Startup thread Thread safety To solve the problem of thread safety (to realize Runnable) -- synchronous code block To solve the problem of thread safety (to realize Runnable) -- synchronization method To solve the Thread safety problem (inhe ...

Posted by surreal5335 on Wed, 26 Feb 2020 20:25:07 -0800

Tear the bottom of the ArrayList by hand to thoroughly analyze the source code

Overview of ArrayList Hello, I'm going to talk about ArrayList today. When it comes to ArrayList, many people know that the bottom of it is implemented using arrays. Threads are not safe. When it comes to its features, it will say that search is fast and increase or decrease slowly, because interview questions are all reciprocal.Let's talk abo ...

Posted by suresh_nsnguys on Wed, 26 Feb 2020 08:23:05 -0800