Merge sort
Merge sort is a very typical application of divide and conquer. The idea of merging and sorting is to recursively decompose the array, and then merge the array.
After the array is decomposed to the minimum, and then two ordered arrays are merged. The basic idea is to compare the front numbers of the two arrays. Whoever is small will ...

Posted by adam_gardner on Sat, 21 May 2022 05:32:56 +0300

Big talk data structure - Summary
Read the book "Dahua data structure" and summarize some things; The summary is rough. Some ideas can't be understood for the time being. Put them aside first, and then go back to digest these knowledge points after learning other things
1. Data structure
A data structure is a collection of ...

Posted by redrabbit on Sat, 21 May 2022 01:17:44 +0300

catalogue
1. What is generics?
2. Generics
2.1 generic syntax
2.2 instantiate a generic class
2.2.1} syntax
2.3 erasure mechanism
2.4 upper bound of generics
2.4.1 grammar
2.4.2 implementation of generic methods
3. Packaging
3.1 basic data type and its corresponding packaging type
3.2 packing and unpacking
Today, let's talk abou ...

Posted by dzekic on Sat, 21 May 2022 00:41:24 +0300

Digital statistics DP (338. Counting problem)
Given two integers ∼ a ∼ and ∼ b, find the number of occurrences of 0 ∼ 9 in all numbers between ∼ a ∼ and ∼ b.
For example, if a=1024 and b=1032, the total number of ， 9 ， between ， a ， and ， b ， is as follows:
1024 1025 1026 1027 1028 1029 1030 1031 1032
Among ...

Posted by artisticre on Fri, 20 May 2022 22:49:00 +0300

foreword
This is the 20th day of the May training camp. Today's training content is binary search tree.
Problem solving report
1. Force buckle 700
Original title link
700. Searching in Binary Search Trees
Topic overview
Given a binary search tree (BST) root node root and an integer value val.
You need to find the node whose node val ...

Posted by Duncan85 on Fri, 20 May 2022 22:40:36 +0300

catalogue
1. Basic concept of stack
2. Simple implementation of stack
3. Code analysis
4. Application scenario
5. Summary
In the first chapter, we talked about the specific data storage structure of data, which is mainly used for data recording.
This chapter mainly talks about an auxiliary tool for conceiving algorithms - stack, which is u ...

Posted by direwolf on Fri, 20 May 2022 12:49:15 +0300

Find actual combat
Case 1: sum of two numbers
Given an integer array nums and a target value target, please find the two integers with and as the target value in the array and return their array subscripts.
You can assume that each input will correspond to only one answer. However, the same element in the array cannot be used twice.
Example:
G ...

Posted by onewaylife on Fri, 20 May 2022 12:03:25 +0300

Demand background:
Recently, in the data R & D platform, there is a search related demand: users can do fuzzy search through the Job name, return the relevant result set, and carry out the complete directory structure. The directory structure of the R & D platform is divided into four types: the root node is the workspace, the sub node ...

Posted by TipPro on Fri, 20 May 2022 07:42:29 +0300

Stack
What is a stack?
Stack is a kind of linear table.
It only allows the insertion and deletion of elements at the fixed end.
The one end for data insertion and deletion is called the top of the stack and the other end is called the bottom of the stack.
Therefore, the stack addition and deletion elements have what we often call last ...

Posted by beboo002 on Fri, 20 May 2022 00:43:56 +0300

CF 1405E Fixed Point Removal
Meaning:
Given the sequence \ (A \) with length \ (n \), the number of \ (A_i = i \) (i.e. the value is equal to its subscript) can be deleted in each operation, and then the remaining arrays are spliced together to ask how many can be deleted at most
\(q \) independent inquiries. Set the number of the first \ ...

Posted by bakigkgz on Thu, 19 May 2022 08:38:13 +0300