Note: PAT-B1032 - which is the best excavator technology

PAT-B1032 - which excavator technology is better Title (20 points) In order to prove which excavator technology is better, PAT organized an excavator skills competition. Now please count the school with the strongest technology according to the competition results. input Enter a positive integer N that does not exceed 10 * * 5 on line 1, th ...

Posted by pbarney on Sun, 23 Jan 2022 17:07:10 +0100

Implementation of snowflake algorithm in singleton mode

Snowflake algorithm The snowflake algorithm is suitable for generating globally unique numbers, such as database primary key id, order number, etc As for why it is called snowflake algorithm, it is because scientists believe that there are no two identical snowflakes in nature through research. Therefore, this algorithm is named ...

Posted by Popgun on Sun, 23 Jan 2022 14:02:09 +0100

2021-06-26 force deduction algorithm problem summary

@Binary tree summary Binary tree phased summary From today on, I began to record my daily study and life. I didn't blog much before. Although I learned some Markdown grammar, I'm still not very familiar with it. The topics of Li Kou are recorded through pycharm. Later, in this form, I'll record all kinds of learning, do algorithm problems and ...

Posted by MrBillybob on Sun, 23 Jan 2022 13:49:58 +0100

[PTA - grade B - detailed explanation] 1014 - Sherlock Holmes's date - I don't understand the series

Description: the difficulty of this topic is not very high, because the topic has described the ideas almost, but there are some details to pay attention to Title: Solution 1: using char array #include<iostream> #include<string> using namespace std; int main() { string s1, s2, s3, s4; cin >> s1 >> s2 >> s3 ...

Posted by TheSaint97 on Sun, 23 Jan 2022 13:32:47 +0100

01 knapsack problem of classical problem of dynamic programming

Problem description Give you a backpack with a weight of W and N items. Each item has two attributes: weight and value. The weight of the ith item is wt[i] and the value is val[i]. Now, what is the maximum value you can pack with this back package? Problem solving ideas 01 knapsack problem is a very classic dynamic programming problem, ...

Posted by tinuviel on Sun, 23 Jan 2022 13:19:17 +0100

Sorting algorithm summary

Sorting algorithm The complexity of each sorting algorithm is as follows: 1. Bubble Sort Bubble sorting is a simple sorting algorithm.It repeatedly visits the sequence to be sorted, compares two elements at a time, and exchanges them if they are in the wrong order.A total of (arr.length - 1) rounds of sorting are performed, and the number o ...

Posted by Ajita on Sun, 23 Jan 2022 12:16:18 +0100

Sword finger - tree chapter (C + +)

Tree article Question 1: depth of binary tree Enter a binary tree and find the depth of the tree. The nodes (including root and leaf nodes) passing from root node to leaf node form a path of the tree. The length of the longest path is the depth of the tree, and the depth of the root node is regarded as 1. Data range: the number of nodes ...

Posted by dlester on Sun, 23 Jan 2022 10:11:20 +0100

Sword finger offer (C + +) -- linked list collection

This series of notes is for self-study algorithm. It only records the problem solving code and some problem solving ideas. All topics are copyrighted by LeeCode and sword finger offer; We recommend a great series of blog for brushing questions and taking notes, which can be used as a reference for the classification of questions in this series: ...

Posted by vcarter on Sun, 23 Jan 2022 07:00:44 +0100

[algorithm] find the lowest common ancestor node of the two nodes of the binary tree

Zuo Cheng cloud algorithm and data structure course https://www.bilibili.com/video/BV13g41157hK?p=2&spm_id_from=pageDriver subject Given the nodes node1 and node2 of two binary trees, find their lowest common ancestor node. Problem solution Solution I Set a HashMap to save the node and its parent node (set the parent node of the root node ...

Posted by willchoong on Sun, 23 Jan 2022 06:53:15 +0100

Introduction to java Foundation Day 6

Array simple basic algorithm 1. Creation of array and element assignment (if you know, there may be) Yang Hui triangle (two-dimensional array), loop number (binary array), 6 numbers, randomly generated between 1-30 and not repeated 2. For numeric arrays Maximum, minimum, sum, average, etc /*Find the maximum, minimum, average, sum, etc. of ...

Posted by wdseelig on Sun, 23 Jan 2022 06:31:03 +0100