leetcode -- string to integer (atoi)

subject Please implement a myAtoi(string s) function to convert the string into a 32-bit signed integer (similar to the atoi function in C/C + +). The algorithm of the function myAtoi(string s) is as follows: Read in the string and discard useless leading spacesCheck whether the next character (assuming it is not at the end of the character) ...

Posted by agnaldovb on Wed, 09 Mar 2022 10:09:35 +0100

Algorithm backtracking method

Full Permutation (leetcode_46) subject Given a sequence without repeated numbers, all possible permutations are returned. Example: Input: [1,2,3] Output: [ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1] ] Problem solution The backtracking method solves the problem. i exchanges with first to generate a new sequence, and constructs a ...

Posted by xpherism on Tue, 08 Mar 2022 22:38:47 +0100

Apriori correlation analysis case -- correlation analysis of shopping cart

1. Introduction of Apriori correlation analysis This part can be seen in my last blog post, which mainly introduces the principle of correlation analysis. Link: Relevance analysis of python machine learning (Apriori). 2. Case background and analysis process There are many kinds of modern goods, and customers often struggle with what to buy. ...

Posted by munky334 on Tue, 08 Mar 2022 22:32:58 +0100

Chained storage is based on java

1 linked list structure The sequence table has the following disadvantages: When inserting or deleting nodes, it is often necessary to move a large amount of dataIf the table is large, it is sometimes difficult to allocate enough memory space, which may lead to memory allocation failure and unable to store In order to overcome the shortcomin ...

Posted by shafiq2626 on Tue, 08 Mar 2022 20:21:09 +0100

Universal parallel search set - Implementation Based on QuickUnion (Java language)

For the implementation of parallel query set based on basic data type, please refer to QuickUnion. The underlying implementation of user-defined object and query set: linked list + Map mapping [the linked list here is represented as a tree] Logically: multiple trees from bottom to top. The array can no longer meet the requirements of user-de ...

Posted by kristian_gl on Tue, 08 Mar 2022 18:42:34 +0100

Graphical big data | Spark machine learning modeling and hyperparametric optimization

Author: Han Xinzi@ShowMeAI Tutorial address: http://www.showmeai.tech/tutorials/84 Article address: http://www.showmeai.tech/article-detail/181 Notice: All Rights Reserved. Please contact the platform and the author for reprint and indicate the source 1. Classification, regression and clustering model 1) Overview of classification algorithm ...

Posted by kkeim on Tue, 08 Mar 2022 17:15:37 +0100

Li Kou Learning + previous life files

Plates between candles Here is a long table with plates and candles lined up on it. Give you a string s with subscript starting from 0. It only contains the characters' * 'and' | ', where' * 'represents a plate and' | 'represents a candle. At the same time, give you a two-dimensional integer array queries with subscript starting from 0, where ...

Posted by lucerias on Tue, 08 Mar 2022 15:42:36 +0100

IMUSTACM training log

Algorithm notes Chapter 1: basic algorithm 1-1 sorting Algorithm classification Ten common sorting algorithms can be divided into two categories: Comparison sort: the relative order between elements is determined by comparison. Because its time complexity cannot exceed O(nlogn), it is also called nonlinear time comparison sort.Non compa ...

Posted by Karamja on Tue, 08 Mar 2022 13:01:34 +0100

"Fool code template" solves three basic problems

"Fool code template" solves three basic problems    Preface: the focus of this article is the establishment and application of fool code template. In the part of knapsack principle, you may talk less and jump. You can focus on absorbing the knowledge of "code template part" and the application method of cod ...

Posted by Hoangsta on Tue, 08 Mar 2022 12:49:30 +0100

Learnopungl notes - V. advanced lighting: "shadow" ("shadow mapping" and "point shadow")

5, Advanced lighting: Shadows (shadow mapping and point shadows) 5.3.1 shadow mapping Shadow is still difficult to implement, because a perfect shadow algorithm has not been found in the field of real-time rendering. At present, there are several approximate shadow techniques, but they all have their own weaknesses and shortcomings, which we ...

Posted by Sorthy359 on Tue, 08 Mar 2022 10:07:40 +0100