National Game Learning -- genetic algorithm

genetic algorithm Intelligent optimization algorithm Several concepts: Population: a group of many individuals Individual (chromosome): equivalent to a solution of the optimization problem to be solved Genes: components of each solution Several operators: Selection: select better individuals from the current population to give them the opp ...

Added by kostik on Wed, 15 Dec 2021 01:48:53 +0200

KetamaHash code to achieve consistency hash (distributed routing algorithm) and principle analysis

KetamaHash code to achieve consistency hash (distributed routing algorithm) and principle analysis What is a consistent hash As a common distributed routing algorithm, consistent hash can well realize the load balancing of the server. When users request, they can hit different servers through the distributed routing algorithm, which can en ...

Added by phpnewby1918 on Wed, 15 Dec 2021 01:38:58 +0200

Data structure -- LeetCode special exercise Day13

 290. Word rules Given a pattern and a string str, judge whether str follows the same rule. The , here refers to complete matching. For example, there is a corresponding law of two-way connection between each letter in pattern , and each non empty word in string , str ,. Example 1: Input: pattern = "Abba", STR = "dog cat ...

Added by fellow21 on Wed, 15 Dec 2021 01:23:26 +0200

[advanced C language] dynamic memory management / allocation

catalogue 1, Why is there dynamic memory management / allocation?         Storage form division of memory 2, Introduction to dynamic memory functions         malloc         free         Practical application of malloc and free         calloc         realloc 3, Common dynamic memory errors         Dereference operation on NULL pointer ...

Added by habuchas on Wed, 15 Dec 2021 00:35:56 +0200

Python learning -- the basic principle of principal component analysis (PCA) and its Python implementation

I. Basic Concept of dimensionality reduction For the high-dimensional data in the actual analysis process, data dimensionality reduction processing is required before specific data analysis and feature modeling. Dimensionality reduction refers to selecting K (k < n) from the N features of the original data for data representation by some ...

Added by aneesme on Tue, 14 Dec 2021 21:59:39 +0200

[offline] persistent data structure (Chairman tree)

Weight segment tree, also known as chairman tree. Weight segment tree, each leaf node represents a weight. Each node has a weight, which represents the number of numbers in the current interval. with This question For example, the data is 1 5 2 6 3 7 4, indicating the array to be queried a []. Discretization Discretization is to change the d ...

Added by kevdotbadger on Tue, 14 Dec 2021 20:47:00 +0200

Five common numerical approximation algorithms implemented by Python

dichotomy The dichotomy is a simple and effective numerical iteration algorithm for an interval [ a , b ] \left[a,b\right] The continuous function fx on [a,b], if it sat ...

Added by bynary on Tue, 14 Dec 2021 20:13:40 +0200

Greedy Title on Final Review - Course Schedule III

subject Solving problems This question is very touching, the last final exam is just in progress, my review (preview) is also in progress, I am a kid who often skips classes (...) How do you review at the end of the term? We must first review the subjects that are closest to the exam time. This topic gives you review time for only one ...

Added by Rose.S on Tue, 14 Dec 2021 19:33:11 +0200

Learning Notes: A Single Case Pattern for Java Design Mode

Singleton mode Definition: Ensure that a class has only one instance and provide a global access point Type: Creative Use scenarios: To ensure there is absolutely one instance in any case Advantage: Only one instance in memory reduces memory overhead Avoid multiple occupation of resources Set up global access points and s ...

Added by Benny007 on Tue, 14 Dec 2021 19:08:38 +0200

Eight sorts of common data structures

catalogue I. insert sort: 1. Direct insert sort; 2. Hill sort 2. Sorting: Select sort Heap sort Exchange sort person name: bubble sort} the simplest sort, but stable Implementation of three recursive methods for quick sorting: Implementation of non recursive method for quick sorting: Merge sort: Count sort I. insert sort: 1. Direct i ...

Added by GreenUser on Tue, 14 Dec 2021 13:14:00 +0200