This article is a note taken when writing questions with the code Capriccio every day, which is used to summarize and review.
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 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
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.
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
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
@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
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
Solution 1: using char array
using namespace std;
string s1, s2, s3, s4;
cin >> s1 >> s2 >> s3 ...
Posted by TheSaint97 on Sun, 23 Jan 2022 13:32:47 +0100
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
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
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
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