[Small Y algorithm]⚡Daily LeetCode clock-in⚡- 45. Most elements
📢Preface
🚀 Algorithmic problems🚀
🌲 Typing an algorithmic problem every day is both a learning process and a sharing process😜🌲 Tip: This column uses both C#and Java for problem solving programming languages🌲 To keep learning every day, let's work together to become the algorithmic God🧐!🌲 Today is the 45th day of punch-in ...
Posted by Hokus on Thu, 30 Sep 2021 09:11:03 -0700
Java interceptor filter pattern
Java interceptor filter pattern
Intercepting Filter Pattern is used to pre / post process the request or response of the application. Define filters and apply them to requests before passing them to the actual target application. The filter can do authentication / authorization / logging, or track requests, and then pass the requests to the co ...
Posted by parawizard on Wed, 29 Sep 2021 21:55:14 -0700
Data structures and algorithms
#Data structure and algorithm Introduction
There is no best algorithm in the world, only the most suitable algorithm
Logical structure
Physical structure
Talk about algorithm
Algorithm time complexity
Just tell you to pay attention to the highest order, then ignore the constant product of con ...
Posted by izzy on Wed, 29 Sep 2021 14:07:18 -0700
[Small Y algorithm]⚡Daily LeetCode clock-in⚡- 43.Sum of Two Numbers II - Input Ordered Array
📢Preface
🚀 Algorithmic problems🚀
🌲 Typing an algorithmic problem every day is both a learning process and a sharing process😜🌲 Tip: This column uses both C#and Java for problem solving programming languages🌲 To keep learning every day, let's work together to become the algorithmic God🧐!🌲 Today is the 43rd day of punch-in ...
Posted by Nhoj on Tue, 28 Sep 2021 09:10:40 -0700
Dynamic programming knapsack problem
Knapsack problem: there are N items and a knapsack with a capacity of W. each item has its own volume W and value v. find out which items can maximize the total value of the items contained in the knapsack. If only 0 or 1 items can be selected for each item, the problem is called 0-1 knapsack problem; If the quantity of each item is not limited ...
Posted by RyanDev on Mon, 27 Sep 2021 21:52:06 -0700
Algorithm learning: 1-1 greedy algorithm
The so-called greedy algorithm is to ensure that each operation is a local optimal solution, so that the final result is a global optimal solution.
Exercise 1:455. Distribute cookies The key to using greedy algorithm is to find greedy strategy, that is, each operation is a local optimal solution.
As can be seen from the question, to satisf ...
Posted by Pastulio on Mon, 27 Sep 2021 06:37:57 -0700
What we must know about binary trees
Trees have some simple basics that you must know
Tree is a nonlinear data structure, which is defined recursivelyNode degree: the number of subtrees contained in a tree is called node degree As shown in the figure, the degree of node A is 6, and the degree of node B is 0Tree degree: the degree of the largest node of a tree is called the degree ...
Posted by LiamProductions on Mon, 27 Sep 2021 06:35:15 -0700
Data structure and algorithm stack and queue
Stacks and queues are linear tables that restrict the insertion and deletion of total equity changes at the end of the table
Stack -- last in first out
Stack algorithms must be used: number system matching, expression evaluation, bracket matching detection, eight queens problem, line editing program, function ca ...
Posted by jazz_snob on Mon, 27 Sep 2021 06:29:13 -0700
Addition (9.25ICPC Game 2 M)
Title Description
Enter description
Output description
sample input
32
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
sample output
0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 ...
Posted by pelleas1022 on Mon, 27 Sep 2021 05:58:52 -0700
[sword finger Offer] search and backtracking algorithm
Sword finger Offer 64. Find 1 + 2 +... + n
For 1+2+...+n, it is required that keywords such as multiplication and division, for, while, if, else, switch, case and conditional judgment statements (A?B:C) cannot be used.
Example 1:
input: n = 3
output: 6
Example 2:
input: n = 9
output: 45
class Solution {
public:
int sumNums(int n) ...
Posted by dcav on Sun, 26 Sep 2021 20:11:35 -0700