Solution of knapsack force complete knapsack programming (C + + 01)
The theoretical content is recorded in the code Capriccio. Here I mainly write my own explanation and review, which is highly recommended
Code capriccio, code Capriccio PDF, code Capriccio Baidu online disk, code Capriccio knowledge planet, code Capriccio octet PDF, code Capriccio brush question route, code Capriccio knowledge planet octethttp ...
Added by NickTyson on Fri, 04 Feb 2022 10:24:52 +0200
LeetCode Learning - Day 29
Day 29
I use C++, forgive me for the mistake. The article was meant to urge me to learn. I would be very happy if it happened to help you.
I. 39. Combination Sum
Give you an array of integers with no duplicate elements, candidates, and a target integer target, find all the different combinations in candidates that can make numbers and tar ...
Added by tipjones on Thu, 03 Feb 2022 21:23:42 +0200
On Array Base Operations
1. Overview of arrays During the execution of a program, a large amount of data is often stored. Java and many advanced languages provide a data structure called an array that can be used to store an ordered set of fixed number of elements with the same element type. Array mainly solves the storage problem of multivariable and multidata, and fa ...
Added by hailam on Thu, 03 Feb 2022 19:55:45 +0200
695. Maximum area of the island (Likou) - JAVA - detailed explanation of depth first search and breadth first search
I Title Description
Give you a binary matrix grid of size m x n. Islands are a combination of adjacent ones (representing land). The "adjacent" here requires that two ones must be adjacent in four horizontal or vertical directions. You can assume that all four edges of the grid are surrounded by 0 (representing water). The area of ...
Added by yrrahxob on Thu, 03 Feb 2022 14:46:01 +0200
[daily force deduction 37] looting
1, Title [LeetCode-198]
You are a professional thief who plans to steal houses along the street. There is a certain amount of cash hidden in each room. The only restrictive factor affecting your theft is that the adjacent houses are equipped with interconnected anti-theft systems. If two adjacent houses are intruded by thieves on the same nigh ...
Added by ekosoftco on Thu, 03 Feb 2022 13:34:45 +0200
I want to beat dynamic programming - edit distance
392. Judgment subsequence
1. Title
Given the strings S and t, judge whether s is a subsequence of t.
A subsequence of a string is a new string formed by deleting some (or not deleting) characters from the original string without changing the relative position of the remaining characters. (for example, "ace" is a subsequence of &quo ...
Added by k9underdog on Thu, 03 Feb 2022 11:23:21 +0200
On the boundary problem of dichotomy and two writing methods
On the boundary problem of dichotomy and two writing methods
We are familiar with the binary search method. For an ordered sequence, we can use the binary search method in
O
(
l
o
g
N
...
Added by devioustree on Thu, 03 Feb 2022 10:10:44 +0200
[Leetcode question brushing record - greed] (C + +)
greedy
Greedy algorithm or greedy idea adopts greedy strategy to ensure that each operation is locally optimal, so that the final result is globally optimal.
assignment problem
455. Distribution of biscuits
Suppose you are a great parent and want to give your children some cookies. However, each child can only give one biscuit at most.
Fo ...
Added by Zack on Thu, 03 Feb 2022 05:45:44 +0200
Algorithm - stack and queue: connected to rain
Algorithm - stack and queue: connected to rain
Give a row of columns with width of 1 and height of n, and calculate the area that can receive rainwater.
Train of thought analysis:
Method 1: using the double pointer method, calculate by column. The first column and the last column do not receive rainwater. Because the width is 1, the area of ...
Added by tserbis on Wed, 02 Feb 2022 20:36:52 +0200
leetcode 1744. Can you eat your favorite candy on your favorite day?
leetcode daily question 1744. Can you eat your favorite candy on your favorite day?
My thoughts
For each query in the querie s, you can calculate the minimum number of meals (equal to days) and the maximum number of meals (equal to days) × The maximum number you can eat per day).
According to example 2, we can think that if we calcula ...
Added by chrischen on Wed, 02 Feb 2022 20:27:29 +0200