Tag：Sort

Time：20201130
In the Internet company MySQL is widely used, and we often have the demand of MySQL performance optimization. Some practical skills in MySQL optimization are sorted out. Schema and data type optimization Integers are usually the best choice for identifying columns because they are fast and usableAUTO_INCREMENT A completely “random” string (for example:MD5()、SHA1()perhapsUUID()Will be arbitrarily […]

Time：20201127
As a developer, it is particularly important to have a learning atmosphere and a communication circleMy IOS communication group: 761407670No matter you are Xiaobai or Danio, welcome to join us, share bat, Ali interview questions, interview experience, discuss technology, let’s communicate, learn and grow together! The following is basically implemented in C language 1. Instead […]

Time：20201127
Sum of three numbers difficultysecondary Here is an array of N integersnums, judgmentnumsAre there three elements a, B, C in a such that a + B + C = 0? Please find all triples that satisfy the condition and do not repeat.be careful:The answer cannot contain duplicate triples. Example:Given array nums = [ 1, 0, […]

Time：20201127
Bubble sort By exchange: if the current element is larger than the next, the two elements are exchanged. The largest element in each scan area is in place java code public class Sort_Bubble { public void bubbleSort(int[] arr){ if (arr == null  arr.length<2) return; for(int len = arr.length1; len>0; len–){ for(int i = 0; […]

Time：20201124
The insert sort pair divides the array into sorted and unsorted parts. Generally, the left side is sorted and the right side is unsortedThen the first element of the unsorted sequence is taken as the element to be inserted, and then the sorted sequence is traversed,Note that we have to traverse the sorted sequence from […]

Time：20201124
Nums is a positive array of integers and integers. Select any number from the [1, n] interval and add it to nums, so that any number in [1, n] interval can be represented by the sum of some numbers in nums. Please output the minimum number of digits that meet the above requirements. Example 1: […]

Time：20201123
Window function Window function is also known as OLAP (online analytical processing) function, which means realtime analysis and processing of database data. Window function is in Oracle and SQL serverAlso known as analysis function, window function syntax is as follows < window function > over ([partition by < column list >] Order by < list […]

Time：20201122
explainExplain simulates the optimizer to execute SQL statements. In 5.6 and later versions, except for select, others such as insert, update and delete can use explain to view the execution plan, so as to know how MySQL processes SQL statements and analyze the performance bottlenecks of query statements or table structures.effect1. Read order of tables2. […]

Time：20201122
The new DT is obtained by conditional query and sorting string clumname = “”; string filtcontext = “”; string wherecode = clumname + “='” + filtcontext + “‘”; /// <summary> ///The new DT is obtained by conditional query and sorting /// </summary> ///< param name = “DT” > source DT < / param > ///< […]

Time：20201120
1. Sort method sort original address sort list.sort(key=None,reverse=False(or True)) When reverse = false: it is a forward sort; When reverse = true: reverse sort. The default is false. 2. Key: sort keyword. The value is a function. This function has only one parameter and returns a value. For example, there is a list of […]

Time：20201119
Explain keyword can simulate the MySQL optimizer to execute SQL statements, and can analyze the performance bottleneck of SQL statements or table structure. Use of explain 1. What is the reading order of the table 2. What are the types of data reading operations 3. Which indexes can be used 4. Which indexes are actually […]

Time：20201118
brief introduction Quick sorting also adopts the idea of dividing and dividing. So what’s the difference between quick sort and merge sort? Merge sort is to split all elements into ordered arrays, and then merge these arrays. Although quicksort is also split, the operation after splitting is to select an intermediate node from the array, […]