Code Capriccio brush questions - string

This article is a note taken when writing questions with the code Capriccio every day, which is used to summarize and review. catalogue 344. Reverse string 541. Reverse string II Sword finger offer 05 Replace spaces 151. Reverse the words in the string Sword finger offer 58 - Ⅱ Left rotation string 28. Implement str () 459. Duplicate ...

Posted by nads1982 on Sun, 23 Jan 2022 23:47:10 +0100

LRU algorithm and LFU algorithm

LRU algorithm LRU is the abbreviation of Least Recently Used, that is, the Least Recently Used algorithm. It is a page replacement algorithm in the operating system. Because the number of pages stored in memory is limited, the recently unused algorithm will be moved out of memory. LRU principle: The principle of LRU is shown in the figure belo ...

Posted by Kyori on Sun, 23 Jan 2022 17:26:43 +0100

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