Eight sorting algorithms, this one is enough (Part I)

1. Analyze the preface and the monologue from @ pen~~ Sorting, as the basis of the algorithm, must be completely mastered, and we must not hold the mentality that it is too low to disdain to learn. It should be noted that no matter how complex the algorithm is, it is optimized step by step. And put aside these, you may also be asked when ...

Added by mattvenables on Wed, 26 Jan 2022 16:24:39 +0200

Week2 of monthly LeetCode weekly questions

catalogue 31. Next arrangement 32. Longest valid bracket 34. Find the first and last position of an element in a sorted array 33. Search rotation sort array 46. Full arrangement 39. Combination sum 77. Portfolio 78. Subset 48. Rotate image 49. Grouping of acronyms 56. Consolidation interval 62. Different paths 75. Color classificat ...

Added by towerspl on Wed, 26 Jan 2022 16:18:31 +0200

Sword finger Offer 57 And are two numbers of s

Sword finger Offer 57 And two numbers with s - LeetCode (LeetCode CN. Com) catalogue Scheme 1: basic method thinking Complexity code Operation results   Scheme 2: improvement of basic method thinking Complexity code Operation results Scheme 3: binary search thinking Complexity code Operation results Option 4: from both sid ...

Added by renegade33 on Wed, 26 Jan 2022 15:48:56 +0200

Chapter III array

Preface: array 1, One dimensional array 1. Understanding of arrays: An array is a collection of multiple data of the same type arranged in a certain order and named with a name, These data are uniformly managed by numbering. 2. Array related concepts: Array name element Corner mark, subscript, index Length of array: number of eleme ...

Added by hbalagh on Wed, 26 Jan 2022 14:28:26 +0200

Vector C + + language implementation of basic data structure and algorithm

0 - General The code is based on data structure C + + language version by Mr. Deng Junhui, with appropriate changes. It feels like this is basically a simplified STL. Follow the book and review the basics of C + + language. 1 - interface declaration The vector class is implemented here. In order to distinguish it from the vector in the stand ...

Added by glcarlstrom on Wed, 26 Jan 2022 11:27:49 +0200

Dichotomy -- P1024 [NOIP2001 improvement group] solution of univariate cubic equation

Question surface: Tangible, such as a x^3 + b x^2 + c x + d = 0. The coefficients of each item in the equation (a, B, C and D are real numbers) are given, and it is agreed that the equation has three different real roots (the range of roots is - 100 to 100), and the absolute value of the difference between roots is ≥ 1. It is required to ou ...

Added by Asinox on Wed, 26 Jan 2022 10:14:02 +0200

[algorithm exercise] LeetCode - dynamic programming learning plan

The title comes from: https://leetcode-cn.com/study-plan/dynamic-programming/?progress=nc4eyhc Climbing stairs (simple) class Solution { public int climbStairs(int n) { if (n <= 2 ) { return n; } int[] ans = new int[n + 1]; ans[1] = 1; ans[2] = 2; for (int i = 3; i <= n; ...

Added by phuggett on Wed, 26 Jan 2022 09:59:19 +0200

The parity rearrangement of NC133 linked list, the maximum path in NC6 binary tree and NC26 brackets of NC16 symmetric binary tree generate NC18 clockwise rotation matrix

Parity rearrangement of linked list Parity rearrangement of NC133 linked list Use a cnt counter When the node is the odd node, it will be inserted into the odd linked list When the node is the even node, it will be inserted into the even linked list Finally, point the next of the tail pointer of the odd chain to the header node of the ...

Added by PatelNehal on Wed, 26 Jan 2022 09:11:11 +0200

LeetCode-241 question - C language implementation

1. Original title [Title Source: LeetCode question 241] given a string containing numbers and operators, add parentheses to the expression and change its operation priority to get different results. You need to give the results of all possible combinations. Valid operation symbols include +, - and *. If the given string is 2 + 1-1 and there ar ...

Added by soto134 on Wed, 26 Jan 2022 08:51:00 +0200

Dynamic Planning Theme (Three Examples: Simple, Medium, Medium)

Example 1: Continuous series (simple interview question 16.17) Title link: Force bucklehttps://leetcode-cn.com/problems/contiguous-sequence-lcci/ Title: Given an array of integers, find the largest continuous sequence of sums and return the sum. Example: Input: [-2, 1, -3, 4, -1, 2, 1, -5, 4] Output: 6 Interpretation: The sum of cons ...

Added by excl209 on Wed, 26 Jan 2022 08:24:32 +0200