Data structure (tree)

1, Binary sort tree Definition: the value of the left subtree is less than the value of the parent node, and the value of the right subtree is greater than the value of the parent node. All nodes meet this definition. Delete: in three cases ① If the deleted node is a leaf node, you can delete it direc ...

Posted by CBaZ on Fri, 14 Feb 2020 00:36:57 -0800

Zzuli? OJ? 1196: counting stars (II) (special subject of structure)

Zzuli? OJ? 1196: counting stars (II) (special subject of structure) Knowledge point: using structure array parameter, sort function Title Description One day, Xiaoming sat in the yard and counted the stars. Gardon asked him to count the number of stars in the sky on the same straight line. There are too many stars in the sk ...

Posted by Jeremiah on Thu, 13 Feb 2020 08:51:01 -0800

DL Python notes task02: text preprocessing; language model; cyclic neural network foundation

Text preprocessing Text is a kind of sequence data. An article can be regarded as a sequence of characters or words. This section will introduce common preprocessing steps of text data, which usually includes four steps: Read in text participle Build a dictionary to map each word to a unique index Co ...

Posted by Jeroen Oosterlaar on Thu, 13 Feb 2020 02:04:01 -0800

poj1475/acwing174 push box

The idea of this question is quite new, but it is not so disgusting compared with the realization Because it is required to move the box less, bfs can be used. Triple (x,y,dir) is used to indicate that the box is in (x,y). dir is the direction of the box where people are Because people are required to m ...

Posted by Otiose Dodge on Wed, 12 Feb 2020 20:33:59 -0800

Shell programming condition test if, for, case, select, while

shell programming condition test Shell Conditional Judgment InitialShell branch if statementShell Loop for StatementShell branch case statementSelect List Select LoopShell loop controls continue,break,exitShell loop while statement Shell Conditional Judgment Initial [] Represents a conditional test, ...

Posted by guxin1999 on Wed, 12 Feb 2020 18:42:12 -0800

Java lambda expression understanding

brief introduction As a new feature of java8, lambda expression is oriented to function programming, which makes the code more concise and improves the programming efficiency. As a developer, we should not only learn to use it, but also understand the operation principle behind it lambda general use ...

Posted by ntohky14 on Tue, 11 Feb 2020 23:45:23 -0800

Natural and customized sorting of TreeSet

Natural and customized sorting of TreeSet TreeSet is an ordered set TreeSet supports two sorting methods, natural sorting and custom sorting. The default is natural sorting TreeSet: the data structure of red black tree is used in the bottom layer. Red black tree is a specific type of binary tree, with ...

Posted by neofox on Tue, 11 Feb 2020 05:21:09 -0800

2 solutions - complete jumping game

Article directory subject Solution 1 (double finger needle method) Solution 2 (violence method) subject You have an array of integers, arr. you start at the first element of the array (subscript 0). At each step, you can jump from subscript i to subscript: i + 1 satisfies: i + 1 < arr.length ...

Posted by magaly on Tue, 11 Feb 2020 03:17:12 -0800

Data Structure Handwriting Tree Traversal (Full Implementation)

1. Summary of Previous Situation This is a tree traversal implementation. To focus on how queues are implemented, follow these articles:Data structure (3) Handwritten queues2. Basic concepts of trees Chain lists, stacks, and queues are one-to-one linear structures, one-to-many linear structures - trees. ...

Posted by amrigo on Mon, 10 Feb 2020 21:47:25 -0800

Diagram of the core implementation of kubernetes container lookup mechanism

After a container is pulled up by kubelet in k8s, the user can specify the way of sniffing to check the health of the container. TCP, Http and command are currently supported. Today, the implementation of the whole sniffing module is introduced to understand the implementation of its periodic detection, counter, delay and other design. 1. Explo ...

Posted by Stunt on Mon, 10 Feb 2020 21:21:00 -0800