Implementation and comparison of six common sorting algorithms

Having nothing to do, I wrote six common sorting algorithms and recorded my essays; 1. Bubble sorting Exchange sorting, compare two adjacent numbers, and move the small one forward, just like a bubble. Time complexity O(n^2), stable. const bubble_sort = function(arr){ const {length} = arr; for(let i = length - 1; i > 0; i --){ ...

Added by vanzkee on Sat, 26 Feb 2022 12:26:38 +0200

Kaggle Titanic

Kaggle Titanic (1) Question: On April 15, 1912, the Titanic sank, and everyone on board did not have enough lifeboats, resulting in the death of 1502 of the 2224 passengers and crew. Although there are some luck factors in surviving, it seems that some people are more likely to survive than others. Build a prediction model to answer the quest ...

Added by lesmith on Sat, 26 Feb 2022 12:22:42 +0200

[algorithm] sword finger Offer special assault version Day4 array part

[algorithm] sword finger Offer special assault version Day4 array part Title address: https://leetcode-cn.com/study-plan/lcof/?progress=wgzvtig Objective: summarize key points and share ideas Note: under reasonable conditions, only use the code that is the simplest to understand and practical to use I [medium] 010 Subarray with and k ...

Added by 00king00 on Sat, 26 Feb 2022 12:04:35 +0200

Algorithm question brushing record (Day 4)

Flip Game(poj1753) Original question link Topic type: Enumeration At the beginning, I was very confused to see this problem. Since the turning of one point will affect the other points next to me, the problems such as which point to turn, how to enumerate, and how to determine whether it is necessary to turn poured into my mind. After thinking ...

Added by craigerjs on Sat, 26 Feb 2022 09:03:03 +0200

Four ways to improve file upload performance, will you?

Business requirementsProduct Manager: Xiao Ming, we need to make an attachment upload request. The content may be pictures, pdf or video.Xiao Ming: it can be realized, but the file size should be limited. It's better not to exceed 30MB. It's too large, the upload is slow, and the server pressure is also high.Product Manager: video is necessary ...

Added by morph07 on Sat, 26 Feb 2022 06:46:27 +0200

Summary and code examples of 11 common time series prediction methods in 4 categories

This article will summarize the time series prediction methods, introduce all methods in categories and provide corresponding python code examples. The following is the list of methods to be introduced in this article:1. Time series prediction using smoothing techniqueexponential smoothing Holt winters method2. Univariate time series prediction ...

Added by fussy on Sat, 26 Feb 2022 05:22:35 +0200

Recursive and non recursive algorithms for pre, middle and post sequence traversal, sequence traversal

preface: This paper introduces the recursive and non recursive algorithms of traversal, among which the non recursive algorithm of post order traversal is the most difficult.Questions included by bloggers: New YoungPlease indicate the source of Reprint: New Young Mind map [the external chain picture transfer fails, and the source st ...

Added by romanali on Fri, 25 Feb 2022 16:06:24 +0200

Leetcode notes -- basic topics of dynamic programming

Catalogue of series articles I Array type problem solving method 1: dichotomy II Array type problem solving method 2: Double finger needle method III Array type problem solving method 3: sliding window IV Array type problem solving method 4: simulation V The basic operation and classic topics of the linked list Vi Classic title of hash tab ...

Added by Redapple on Fri, 25 Feb 2022 15:35:16 +0200

Luogu P2387 [NOI2014] magic forest solution

Luogu P2387 [NOI2014] magic forest solution Title Link: P2387 [NOI2014] magic forest Meaning: each side has edge right a , b a,b a. B two, please 1 ...

Added by gckmac on Fri, 25 Feb 2022 15:08:30 +0200

Simple greedy strategy

Greed and proof To choose the greedy strategy, we must first prove that the greedy strategy is correct before we can consider using it. In many cases, the rationality of greed is not obvious, but if we can find a counterexample, it can prove that such greed is not correct. Fractional Knapsack Problem Fractional Knapsack Problem When the it ...

Added by alex_lana on Fri, 25 Feb 2022 06:48:11 +0200