Java description LeetCode, 209 Minimum size subarray sum is the sum of subarrays with the smallest length, sliding window; Prefix and + binary search;
Hello everyone, I'm hehaige. I focus on the back end. If I can, I want to be a code designer instead of an ordinary coder to witness the growth of hehaige. Your comments, praise and attention are my biggest motivation. If there are mistakes, please don't hesitate to give me advice. Thank you very much. Let's support the original! If there is a ...
Posted by Phrozt on Sat, 08 Jan 2022 10:37:41 +0100
Version change of
Title Description
You are given two integer arrays nums1 and nums2 in non decreasing order, and two integers m and n representing the number of elements in nums1 and nums2 respectively. Please merge nums2 into nums1 so that the merged array is also arranged in non decreasing order.
Title Example
Example 1:
Input: nums1 = [1,2,3,0,0,0], ...
Posted by oneday on Fri, 07 Jan 2022 10:58:04 +0100
javaScript force deduction problem -- simple tree
104. Maximum depth of binary tree
Left and right nodes are recursive, and + 1 if there are nodes;
DFS} bottom-up recursion
var maxDepth = function(root) {
if(root==null)return 0;
let maxleft = maxDepth(root.left);
let maxright=maxDepth(root.right);
return Math.max(maxleft,maxright)+1;
};
Recursive three parts: ...
Posted by localhost1 on Fri, 07 Jan 2022 09:57:36 +0100
Sword finger OfferII 001 Integer division
0. Title Description
Sword finger Offer II 001 Integer divisionTitle Description: divide integers and round the result (discard decimal places)Title Requirements: do not use *, /,%Constraint condition: [- 231 - 1]. If the division result overflows, 231 - 1 will be returned
1. Content description
The following four solutions come from Easy ...
Posted by All4172 on Wed, 05 Jan 2022 19:06:51 +0100
Sword finger offer brush questions 20 minutes (07 16 33)
Sword finger Offer 07 Rebuild binary tree
Enter the results of preorder traversal and inorder traversal of a binary tree, please build the binary tree and return its root node. It is assumed that the input pre order traversal and middle order traversal results do not contain duplicate numbers. This problem uses the idea of recursion. Use pre ...
Posted by riiel on Wed, 05 Jan 2022 17:38:45 +0100
Leetcode special training recursion and divide and conquer
brief introduction
Divide and conquer algorithm design idea
Recursion and divide and conquer
Design idea of recursive function: divide and rule (reduce and rule)
Top down problem solving
Why use stacks?
This step was also understood when I looked at the sword finger offer.
"Go out first" when splitting, and &quo ...
Posted by apervizi on Wed, 05 Jan 2022 12:19:10 +0100
[Leetcode] self designed data structure of data structure -- python version
This article summarizes the common algorithms of designing data structure according to labuladong's algorithm sketch, which is implemented in Python 3
LRU algorithm
LRU(Least Recently Used) algorithm is a cache elimination mechanism. The computer's cache capacity is limited. If the cache is full, some contents will be deleted. What content ...
Posted by sintax63 on Wed, 05 Jan 2022 11:29:59 +0100
[data structure and algorithm] in-depth analysis of the solution idea and algorithm example of "stone game IX"
1, Title Description
Alice and Bob designed a new stone game again. There are n stones in a row. Each stone has an associated number to represent its value. They give you an integer array stones, where stones[i] is the value of the ith stone.Alice and Bob take turns in their own rounds. Alice takes the lead. In each round, players need to remo ...
Posted by NME on Tue, 04 Jan 2022 23:15:23 +0100
[sword finger Offer special assault version] 013 - 026
catalogue
2, 013 - 026
Sword finger Offer II 013 Sum of two-dimensional submatrix
13.1 problem solving
13.2 solution
Sword finger Offer II 014 Anagrams in strings
14.1 problem solving
14.2 solution
Sword finger Offer II 015 All modifiers in the string
15.1 problem solving
15.2 solution
Sword finger Offer II 016
16.1 problem solving ...
Posted by designxperts on Tue, 04 Jan 2022 17:24:51 +0100
2021-12-27 swipe questions and punch in every day
2021-12-27 swipe questions and punch in every day
Force buckle - sort
75. Color classification
Given an array of n elements including red, white and blue, sort them in place so that the elements of the same color are adjacent and arranged in the order of red, white and blue.
In this problem, we use integers 0, 1 and 2 to represent red, whit ...
Posted by Pavlos1316 on Tue, 04 Jan 2022 16:27:19 +0100