Discrete explanation and unique principle analysis

Discretization Principle and application: When the value range of a given data is large, but the data is very scattered, the magnitude of useful data is far lower than the value range. For example, from − 1 0 9 ...

Posted by nawal on Fri, 24 Sep 2021 20:25:43 -0700

[Algorithm-LeetCode] 429.Hierarchical traversal of N-fork trees (N-fork trees; Hierarchical traversal; BFS)

429.N-Fork Tree Hierarchical Traversal-Force Button (LeetCode) Release: September 25, 2021 01:01:25 Problem description and examples Given an N-fork tree, returns the hierarchical traversal of its node values (that is, from left to right, traverse layer by layer). The serialized input to the tree is traversed in sequence, with each set of ...

Posted by joshblue on Fri, 24 Sep 2021 09:41:58 -0700

7-11 key activities (30 points)

Title Link 7-11 key activities (30 points) Suppose an engineering project consists of a group of subtasks, some of which can be executed in parallel, and some must be executed after completing other subtasks. "Task scheduling" includes a group of subtasks and the subtask set on which each subtask can execute. For example, completin ...

Posted by runthis on Fri, 24 Sep 2021 09:22:03 -0700

Ten algorithms commonly used by programmers

1. Binary search algorithm (non recursive implementation) 1.1 introduction to binary search algorithm (non recursive) We have known about the binary search algorithm before, but the recursive implementation is used. Next, we understand the non recursive implementation of the binary search algorithm (note): the binary search algorithm is onl ...

Posted by anthony-needs-you on Fri, 24 Sep 2021 08:39:02 -0700

The way of Java learning - Set interface, HashSet interface implementation class (important)

Work hard and see you at the top! come on. 1, Set interface 1. Introduction to set interface Out of order (the order of addition and extraction is inconsistent) and there is no indexDuplicate elements are not allowed and contain at most one null 2. Traversal mode iterator Enhanced for loop (the underlying is also an iterator)Cannot g ...

Posted by bnownlater on Fri, 24 Sep 2021 08:13:08 -0700

Leetcode 18 sum of four numbers

Problem description Give you an array of n integers, nums, and a target value, target. Please find and return the quads [nums[a], nums[b], nums[c], nums[d]]: 0 <= a, b, c, d < n a. b, c and d are different from each other nums[a] + nums[b] + nums[c] + nums[d] == target You can return answers in any order. Example 1: Input: num = [1 ...

Posted by therealchuckles on Fri, 24 Sep 2021 07:22:26 -0700

Maximum common string, maximum common subsequence, edit distance, myers and other algorithms

1 Preface The four algorithms are similar, and have the following similarities and differences 2 similarities and differences Take STR1 = "ABCDEF", STR2 = "zabcdze" as an example Similarities: 1. Get a target on a string; 2. The core of the algorithm is the idea of dynamic programming. difference: 1. The targets are d ...

Posted by dreado on Fri, 24 Sep 2021 06:04:22 -0700

Java notes - 05. Array

05. Array Array is a reference type, and array data is an object After the array is created, if there is no assignment, there are default values: byte[0], short[0], int[0], long[0], float[0.0], double[0.0], char[\u0000], boolean[false], String[null] Array assignment mechanism Basic data type assignment. This value is specific data and d ...

Posted by public-image on Fri, 24 Sep 2021 05:46:12 -0700

430. Flat multi-level bidirectional linked list

time September 24, 2021 subject In the multi-level bidirectional linked list, in addition to the pointer to the next node and the previous node, it also has a sub linked list pointer, which may point to a separate bidirectional linked list. These sub lists may also have one or more of their own sub items, and so on to generate multi-level da ...

Posted by kneifelspy on Fri, 24 Sep 2021 02:43:47 -0700

Eight sorting (detailed analysis + dynamic diagram demonstration)

Direct insert sort Dynamic diagram demonstration: Basic idea: Insert the records to be sorted into an ordered sequence one by one according to the size of their key values, until all records are inserted into the sequence A new ordered sequence is obtained. Code implementation: void InsertSort(int* a, int n) { for (int i = 0; i < ...

Posted by GreyFilm on Fri, 24 Sep 2021 02:32:10 -0700