The interviewer asked me to go back and look at the first question.
⭐ Introduction ⭐ Neodymium Hi everyone, I'm stuck. Today we are explaining the series of classical sums. It's good to say that some people can't do the first thing while watching the sea at night. You should all know that the first question of power button is the sum of two numbers. But in fact, the sum of two numbers is only the beginning. I ...
Posted by greatepier on Thu, 30 Dec 2021 23:03:46 +0100
Calculation of 399 division of force deduction problem
Give you a variable pair array equations and a real value array values as known conditions, where equations[i] = [Ai, Bi] and values[i] jointly represent the equation Ai / Bi = values[i]. Each Ai or Bi is a string representing a single variable.
There are also some problems represented by array queries, where queries[j] = [Cj, Dj] represents t ...
Posted by sanlove on Thu, 30 Dec 2021 22:37:59 +0100
Acwing Chapter V dynamic programming
Acwing Chapter V dynamic programming (I)
1, 01 knapsack problem
n items, a backpack with a capacity of v. each item has two attributes: Volume vi and value wi. Each item can only be used once. What is the maximum value of the target?
f(i,j) is selected from 1 - i articles, and the total volume does not exceed j
Set: represents all selections
S ...
Posted by rakuci on Thu, 30 Dec 2021 22:15:41 +0100
Sorting algorithm Counting Sort
Summary
Bubble, Select, Insert, Merge, Fast, Hill, Heap Sort, are all sort based on comparison
The lowest average complexity is O(nlog(n)) Count, bucket, cardinality sort, not comparison-based sort
Is a typical space-exchange time, and in some cases, the average time complexity can be lower than O(nlog(n))
Core Ideas
Count the n ...
Posted by su1d on Thu, 30 Dec 2021 21:35:20 +0100
python loop performance pk
python loop performance pk
In any programming language, loops are very time-consuming operations. Assuming that any simple one-step operation takes one unit of time, repeat this operation for tens of thousands of times, and the final time will increase by tens of thousands of times. As we all know, python is not a language with high execution ...
Posted by randydg on Thu, 30 Dec 2021 19:36:39 +0100
[Python] multi classification algorithm Random Forest
[Python] multi classification algorithm Random Forest
This paper will mainly describe the multi classification application of Random Forest, which can also be used in secondary classification. This paper uses scikit learn framework.
1, Import base library
Import the relevant libraries of data processing and drawing. In order to make ...
Posted by dtyson2000 on Thu, 30 Dec 2021 15:45:05 +0100
[data structure and algorithm] LeetCode single linked list exercise
Reverse linked list
Title link here
Three pointers:
Problem solving ideas:
First analyze the special case. When the linked list is empty or there is only one node, directly return to head When there are more than one node in the linked list, we first consider whether we can reverse the pointer in turn, so as to reverse the linked list ...
Posted by quetz67 on Thu, 30 Dec 2021 11:13:37 +0100
The binary tree is constructed by different traversals (pre order, middle order, post order, middle order)
1,Constructing binary tree from preorder and inorder traversal sequences
Given the preorder and inorder of a tree. Construct a binary tree and return its root node.
Example 1:
Input: preorder = [3,9,20,15,7], inorder = [9,3,15,20,7]Output: [3,9,20,null,null,15,7]Example 2:
Input: preorder = [-1], inorder = [-1]Output: [-1]
recursion
...
Posted by prue_ on Thu, 30 Dec 2021 08:14:58 +0100
Collection of C + + algorithm learning templates -- Number Theory
A journey of ten thousand miles begins with a single step. This blog summarizes some number theory templates learned in the summer, so as to facilitate future query and use. The author's level is limited, and there will inevitably be omissions. I urge you to correct it. It would be a great honor if my article could help you. Thank lyh and lyk f ...
Posted by jimmyhumbled on Thu, 30 Dec 2021 07:07:04 +0100
[hash series] my roommate was worried that I couldn't sleep in the final exam. I prepared this set of hash topics all night
⭐ Introduction ⭐ ️ Hello, I'm Zhijie. Today we will bring you a set of special training questions for hash questions. Hash table plays a very important role in data structure. Many students always learn theoretical knowledge and lack practical use. The so-called generals are all killed from the battlefield. If you want to become the great God ...
Posted by phazorRise on Thu, 30 Dec 2021 05:00:23 +0100