leetcode brush record day002:189 and 217

189. Medium difficulty: the content refers to the official answer Think of the array as a ring connected end to end. Moving right is equivalent to rotating the ring Requirements: 1. Use the in-situ algorithm with spatial complexity O(1) to solve this problem; 2. There are at least three different ways to solve this problem Problem solving ide ...

Posted by dunnsearch on Fri, 17 Sep 2021 04:04:11 +0200

Simulating pedestrian crossing zebra line matlab code based on Cellular Automata

1 algorithm Introduction 1.1 Introduction Complex Science In the 1980s, complex science was first proposed by the SantaFe school in the United States, which has attracted worldwide attention. At present, scientific research on complexity and complex systems occupies an increasingly important position, so that it is known by some scientists a ...

Posted by friedice on Thu, 16 Sep 2021 22:20:49 +0200

Algorithm notes Chapter 4 ~ 5

Chapter IV Hashtable A brief introduction to hash table 1) Hash table can be understood as a collection structure at the use level 2) If there is only key and no accompanying data value, you can use the HashSet structure (unorderderdedset in C + +) 3) If there are both key s and accompanying data value s, you can use the HashMap str ...

Posted by chiefmonkey on Thu, 16 Sep 2021 22:12:21 +0200

There were a few things going on on September 16, but try to keep a record of what you did (prefix tree, dictionary tree, deep pruning)

Today's daily question is Word Search 2 At first you want to try how much deep search you can do, and the result is over. class Solution: def findWords(self, board: List[List[str]], words: List[str]) -> List[str]: #Try it with a deep search first wordSet = set(words) direction= [(0,1),(0,-1),(1,0),(-1,0)] ...

Posted by Inkeye on Thu, 16 Sep 2021 20:13:49 +0200

[optimization prediction] BP neural network prediction optimized by tianniu Xu algorithm [matlab phase 1316]

1, Introduction to longicorn whisker search algorithm 1. Definition of longicorn whisker search algorithm Beetle antennae search bas, also known as beetle search, is an efficient intelligent optimization algorithm proposed in 2017. Similar to intelligent optimization algorithms such as genetic algorithm, particle swarm optimization algorithm a ...

Posted by wkrauss on Thu, 16 Sep 2021 05:11:56 +0200

Classification using kNN algorithm python implementation

Ideas and steps of kNN algorithm The basic idea of kNN algorithm is as follows: Suppose there are n samples in the sample set, which have discrimination on m features, and they belong to one of 0 or 1 respectively. Suppose the eigenvector of the ith sample is ( a ...

Posted by phpcharan on Thu, 16 Sep 2021 02:17:28 +0200

[optimization prediction] BP neural network prediction optimized by tianniu Xu algorithm [Matlab 1318]

1, Introduction to longicorn whisker search algorithm 1. Definition of longicorn whisker search algorithm Beetle antennae search bas, also known as beetle search, is an efficient intelligent optimization algorithm proposed in 2017. Similar to intelligent optimization algorithms such as genetic algorithm, particle swarm optimization algorithm a ...

Posted by volka on Wed, 15 Sep 2021 23:36:38 +0200

Step by step, red and black trees in Java

Red-black tree is one of many "balanced" search tree patterns, and in the worst case, its associated operation is O(log n). 1. Properties of red and black trees A red-black tree is a binary lookup tree. Unlike ordinary binary lookup trees, each node of a red-black tree has a color attribute whose value is either red or black. By re ...

Posted by TalonFinsky on Tue, 14 Sep 2021 22:49:34 +0200

Algorithm data structure - DC3 algorithm

Suffix and array          Suffix array actually represents all suffix strings. After ranking, write them down from No. 0 to No. 7 in turn. This is the so-called suffix array         There will not be the same ranking because the length is different Generate suffix array ...

Posted by CorfuVBProgrammer on Mon, 13 Sep 2021 19:44:01 +0200

[Cellular Automata] Radical Strategy Cellular Automata Three-lane (no accessory roads, Software Park effects) Traffic flow model matlab source code

1. Introduction to Cellular Automata Development of 1-cell automata The original cellular automata was proposed by Von Neumann in the 1950s to mimic the self-replication of biological cells.But it has not been taken seriously by the academia. It was only after John Horton Conway of the University of Cambridge designed a computer game called &q ...

Posted by k.soule on Mon, 13 Sep 2021 18:45:27 +0200