Sliding window - LeetCode

sliding window Topic introduction 76. LeetCode (LeetCode CN. Com) This topic says that we should at least ask for a substring. If we can't find a substring, How to find the shortest one, Let's assume that we have a table to record how many times each letter appears and how many times one appears, and we store it in an array, The ...

Added by Xoom3r on Fri, 28 Jan 2022 00:09:47 +0200

Similarity algorithm of recommendation system based on elastic search algorithm

1, Introduction to recommendation system The recommendation system is mainly based on the analysis and processing of the user's historical behavior data to find the content that the user may be interested in, so as to actively recommend the content that the user may be interested in to the user; From the perspective of the long tail theory of ...

Added by multe-media on Fri, 28 Jan 2022 00:07:16 +0200

LeetCode questions 46-47 full arrangement 1-2

First reaction How do I feel like I've done similar problems. Compare with question 31 "next arrangement" The next permutation of an array of integers refers to the next lexicographically ordered permutation of its integers. More formally, if all permutations of an array are arranged in a container from small to large according to ...

Added by phr0stbyte on Thu, 27 Jan 2022 21:19:08 +0200

C++ Labyrinth Problem

Title Description The labyrinth consists of N rows of M-column cells (n,m are less than 50), each of which is either empty or obstructed. 1 for open space 2 for obstacles Now please find a shortest path length from start to end Input Format The first row input n,m means there are n rows and m columns Next, type 1 and 2 for open space an ...

Added by raydar2000 on Thu, 27 Jan 2022 20:58:15 +0200

Daily supplementary record II

2045. Second short time to destination Cities are represented by a two-way connected graph, in which there are n nodes, numbered from 1 to n (including 1 and N). The edges in the figure are represented by a two-dimensional integer array edges, where each edge [i] = [ui, vi] represents a two-way connected edge between node ui and node VI. Each ...

Added by sbinkerd1 on Thu, 27 Jan 2022 19:51:01 +0200

Branch and bound method | algorithm design and analysis 2

Note: Mr. Liu's notes on the content of algorithm design and analysis course this semester People who have to stick to it until the end feel great Besides, PPT is not well understood by the teacher behind the teacher. Of course, it may be because I am always distracted and make complaints about it. 🤔 Branch gauge Loading problem analysis 🚩 ...

Added by ninevolt1 on Thu, 27 Jan 2022 17:53:15 +0200

[algorithm cultivation] dynamic programming topic 1: basic problem solving skills, subsequence problems, array traversal order

1, Basic problem solving skills of dynamic programming Learning from: https://labuladong.gitee.io/algo/3/23/71/ 1.1 change exchange (medium) Make four points of analysis on the topic: base case, state (variables changed in the original problem and sub problem), selection (what causes the state to change), and the meaning of dp array B ...

Added by steve@MRS on Thu, 27 Jan 2022 17:19:06 +0200

Interval maintenance (block method + card constant)

Title Description: Title portal Problem solving ideas: First, we ignore the title of the topic (tree array template), and let's try a new algorithm - blocking. Block thought Blocking is a beautiful violence (by DFT). His core idea is to maintain an interval (length: n ...

Added by tsabar on Thu, 27 Jan 2022 12:41:35 +0200

Depth first entry? Let's look at the maze first

What is depth first What is depth, that is, down, depth first, that is, down first, go to the end at one breath, go to the end, and go back when you find there is no way.In terms of algorithm implementation, depth first can be considered as a pronoun of recursion, and depth first search must use the idea of recursion.Some people may say that ...

Added by andy666 on Thu, 27 Jan 2022 11:45:53 +0200

Force deduction brush question notes

LeetCodeSelf use notesarray27. Remove elementsGive you an array num and a value val. you need to remove all elements with a value equal to Val in place and return the new length of the array after removal.Instead of using extra array space, you must use only O(1) extra space and modify the input array in place.The order of elements can be chang ...

Added by thereo on Thu, 27 Jan 2022 07:49:27 +0200