leetcode DFS+BFS+DSU question brushing summary 2
leetcode DFS+BFS+DSU question brushing summary 2
1-symmetric binary tree Title Link: Link here!!!
Idea 1: iterative method For a binary tree, the left and right subtrees enter the queue respectively. If the left and right subtrees are empty, the traversal ends. If only one of the left and right subtrees is empty, or the root nodes of the left ...
Added by xlordt on Sun, 27 Feb 2022 15:58:15 +0200
leetcode: Week 1
Catalogue of series articles
leetcode: Week 1
preface
. The blogger has just finished the study of RHCE. Next, he decides to brush the algorithm problem of leetcode, 2-3 times a day, and consolidate the review at the weekend.
first day
1. Binary search
Given an n-element ordered (ascending) integer array nums and a target value ...
Added by Northern Flame on Sun, 27 Feb 2022 10:53:56 +0200
Template meta programming example -- how to design a general geometry Library
Template meta programming example - how to design a general geometry Library
design principle
Suppose you need to use a c + + program to calculate the distance between two points You might do this:
First define a struct:
struct mypoint
{
double x, y;
};
Then define a function containing the calculation algorithm:
double distance(myp ...
Added by Skaara on Sun, 27 Feb 2022 06:25:57 +0200
Practical application of tree structure 2
Binary sort tree
Requirements: for a sequence (7, 3, 10, 12, 5, 1, 9), it is required to query and add data efficiently
Basic introduction: Binary sort tree: BST: (Binary Sort(Search) Tree). For any non leaf node of the binary sort tree, the value of the left child node is required to be smaller than that of the current node, and the valu ...
Added by jefffan24 on Sun, 27 Feb 2022 05:43:02 +0200
Leetcode 746. Climbing stairs with minimum cost (dynamic programming method and optimization solution)
Title address
Leetcode 746. Climb stairs with minimum cost
Title Description
Give you an integer array cost, where cost[i] is the cost of climbing up the ith step of the stairs. Once you pay this fee, you can choose to climb up one or two steps.
You can choose to climb the stairs from the steps with subscript 0 or subscript 1.
Please calc ...
Added by gladius on Sun, 27 Feb 2022 05:03:42 +0200
Study notes on lightweight network structure mobilenetv1, v2 and v3
Today, I'm going to take a simple note of mobilenet. I'm afraid I'll forget the relevant contents of mobilenet. First of all, we need to know that mobilenet is a model framework that can be used on embedded devices. Therefore, its biggest advantage is that it has less parameters, and we still need to ensure that the accuracy of computer vision ...
Added by sunnyside on Sun, 27 Feb 2022 02:07:34 +0200
[Jeremy Wu] adventure Road, ordinary road (C + +) kkmd66
Description:
Night Fury is a very rare and most dangerous and intelligent dragon from "master of dragon training 2". It is very different from other dragons in shape. It is similar to bats. At the same time, it combines the size of cats and the sharp eyes of wild wolves, with black scales on its body. The volume is petite, the expres ...
Added by TGM on Sat, 26 Feb 2022 18:18:09 +0200
[orderly charging] optimize the orderly charging of electric vehicles based on genetic algorithm, with Matlab code attached
1 Introduction
In order to ensure that the transformer is not overloaded when charging the electric vehicle in the community, an orderly charging control method of the electric vehicle in the community based on genetic algorithm is proposed On the basis of comprehensively considering the charging demand of users, aiming at not changing the pow ...
Added by chawezul on Sat, 26 Feb 2022 17:35:36 +0200
Knapsack problem C++
Convenient for self review ==
1.01 Backpack
Problem Description: there are n valuable items and a backpack with a volume of v. there is one for each item. Calculate the maximum value of the items that the backpack can hold.
Analysis process:
1. Describe the state: we use f [i] [j] to indicate that only the first I items are selected, and th ...
Added by adam119 on Sat, 26 Feb 2022 17:19:35 +0200
True title of Blue Bridge Cup: Crop hybridization
Sample input and output
Examples
input
6 2 4 6
5 3 4 6 4 9
1 2
1 2 3
1 3 4
2 3 5
4 5 6
output
16
Violent dfs is enough. We should think about the conditions we have:
1. Planting time of N seeds
2.M existing seeds
3.K hybrid scheme
4. Find the shortest time to plant T
How do I get to dfs?
First of all, the boundary ...
Added by shack on Sat, 26 Feb 2022 13:56:55 +0200