day22_0519
choice question
1: simply select the best time O(n^2) average time O(n^2) worst time O(n^2) 2: Directly insert the best time O(n) average time O(n^2) worst time O(n^2) 3: Bubble sort best time O(n) average time O(n^2) worst time O(n^2) 4: Hill sort ＾ best time ＾ O(n) average time O(logn) worst time ＾ O(n^s) 1 < s < 2 ...

Posted by QuietWhistler on Fri, 20 May 2022 01:49:27 +0300

LeetCode algorithm
Most bogey, hope to do a series of articles to record the process of brushing algorithm.
At present, it is mainly based on LeetCode https://leetcode-cn.com/circle/article/48kq9d/ The module of this post will brush the questions.
The content is mainly the summary of the landlord in the post, as well as some personal experience ...

Posted by shak123 on Thu, 19 May 2022 20:46:21 +0300

0. Always say
It's time to pick up your studies that have been neglected for so long. Today is 2022-05-18. Brush at least two questions every day. I've written the first few times and directly abbreviated them.
1. 1. Sum of two numbers
1. Title Description
2. Topic analysis
Traverse to find two numbers with mapping relationship, so y ...

Posted by php3ch0 on Thu, 19 May 2022 01:06:23 +0300

brief introduction
We found that the front-end and back-end projects of indexf are very frequent, no matter when we are working on them recently!
The meaning of indexOf: a given string matches the subscript of another string. If it matches, it returns the subscript. If it cannot match, it returns - 1. In fact, the principle is relatively simple ...

Posted by dbomb101 on Wed, 18 May 2022 20:40:42 +0300

preface
Template, as the name suggests, is a fixed and standardized thing.
Template method pattern is a behavior design pattern. It defines an algorithm framework in superclass, allowing subclasses to rewrite specific steps of the algorithm without modifying the structure.
Scene problem
Suppose we are masters of a beverage shop, we need at leas ...

Posted by thekidscareya on Wed, 18 May 2022 14:59:35 +0300

Serialize and deserialize binary search trees
Title [leetcode449]
Serialization is the process of converting a data structure or object into a series of bits so that it can be stored in a file or memory buffer, or transmitted over a network connection link for later reconstruction in the same or another computer environment.
Design an algorithm ...

Posted by idire on Wed, 18 May 2022 13:53:33 +0300

Topic description
Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.
Now given an array of n integers, look for three numbers that add up to 0. Find all the different groups, each group consists of three numbers, and the sum of the t ...

Posted by BlueSkyIS on Wed, 18 May 2022 09:50:36 +0300

Constantly updating
Problem solution
455 distribution of biscuits
Suppose you are a great parent and want to give your children some cookies. However, each child can only give one biscuit at most. For each child i, there is an appetite value gi, which is the minimum size of biscuits that can satisfy the children's appetite; And every cookie ...

Posted by mechamecha on Wed, 18 May 2022 06:40:12 +0300

This article mainly introduces the parallel search algorithm
1, Dynamic connectivity
Before introducing the algorithm, let's talk about what it is from and what problems it solves.
First look at the diagram to understand dynamic connectivity.
There are 10 points in the figure, one point pair is given at a time, for example (4, 3), which means ...

Posted by adhi_nugraha on Wed, 18 May 2022 06:16:46 +0300