day6 list job

1. Basic questions Given a list of numbers, print all odd numbers in the list scores = [45, 60, 89, 30, 12, 59, 99, 80, 71, 66, 1000] for i in scores: if i % 2 != 0: print(i) Given a list of numbers, print all the numbers in the list that can be divided by 3 but cannot be divided by 2 scores = [45, 60, 89, 30, 12, 59, 99, 80, 7 ...

Added by Cleibe on Mon, 21 Feb 2022 15:33:05 +0200

[algorithm cultivation] graph theory algorithm II (topological sorting, bipartite graph, and search set)

Learn from https://labuladong.gitee.io/algo/2/19/36/ 1, DFS implements topology sorting Immediately above: why do you need to reverse the result of post order traversal to get the result of topological sorting? Take the above binary tree as a directed graph and point from the root node to the left and right child nodes. Then, the root nod ...

Added by sapoxgn on Mon, 21 Feb 2022 15:21:51 +0200

Binary tree topic 03

Question 1: Question 617 of force deduction Problem solving ideas: reference This article The code is as follows: class Solution { public TreeNode mergeTrees(TreeNode root1, TreeNode root2) { if(root1 == null) { return root2; } if(root2 == null) { return root1; } TreeNode r ...

Added by guiltyspark on Mon, 21 Feb 2022 14:35:22 +0200

[paper reproduction] genetic algorithm image denoising: Effective Hybrid Genetic Algorithm (EHGA)

Effective Hybrid Genetic Algorithm (EHGA) STEP 1: input image Read image X ( i , j ) X(i,j) X(i,j), where i ...

Added by Comdemned on Mon, 21 Feb 2022 12:35:49 +0200

Deepening and improving JAVA foundation [Chinese]

data structure Main contents: Introduction to data structure linear structure tree structure Introduction to data structure 1 what is a data structure In short, a data structure is a container that stores data in a specific layout. This "layout" determines that a data structure is efficient for some operations and inefficient for ...

Added by ineedhelp on Mon, 21 Feb 2022 06:29:31 +0200

[Leetcode notes] monotonous stack

I have encountered a lot of monotonous stack problems when I brush questions recently. I hereby record it. I forget it all in the future. The monotone stack problem has a feature that most of the stack does not store elements directly, but subscripts, which are used to judge. Monotone stack, as the name suggests, means that the elements stored ...

Added by FijiSmithy on Sun, 20 Feb 2022 20:48:22 +0200

Prefix and brush question summary of leetcode 2

Prefix and brush question summary of leetcode 2 1 - region and retrieval - array immutable Title Link: Title Link stamp here!!! Idea: simple prefix sum. During initialization, use the sum array to store the prefix sum of the num array, and then calculate the interval sum from left to right in the num array, which can be obtained directly from ...

Added by DamianTV on Sun, 20 Feb 2022 20:03:37 +0200

In the PyCharm, the function encapsulates the code and calls it in JupyterNoteBook - take the KNN algorithm as an example (K nearest neighbor algorithm).

1. Main content of the article This blog is devoted to explaining the skills to encapsulate code in PyCharm and invoke it in JupyterNoteBook. Through the learning of this blog, taking KNN algorithm as an example, it is intended to grasp the skills of functional code in plain language. It takes about 5 minutes to read this blog. Note: the c ...

Added by adeelahmad on Sun, 20 Feb 2022 19:51:00 +0200

Data structure (C language version) -- sorting notes

1. Basic concepts of sorting Sorting is an operation often carried out in the computer. Its purpose is to adjust a group of "unordered" record sequences to "ordered" record sequences. The purpose of sorting is to facilitate searching. If the whole sorting process can be completed without accessing external memory, th ...

Added by zoidberg on Sun, 20 Feb 2022 19:35:22 +0200

Greedy algorithm ----- LeetCode 321 maximum number of splices

Title Description Given two arrays of length m and N, the elements are composed of 0-9, representing the numbers on each bit of two natural numbers. Now select k (k < = m + n) numbers from the two arrays and splice them into a new number. The numbers taken from the same array are required to maintain their relative order in the origina ...

Added by sundru on Sun, 20 Feb 2022 19:15:15 +0200