"Li Kou" question 1673: find the most competitive subsequence (stack)

"Li Kou" question 1673: find the most competitive subsequence (stack) Give you an integer array num and a positive integer k, and return the most competitive num subsequence with length K. A subsequence of an array is a sequence obtained by deleting some elements from the array (elements may not be deleted). In the first different ...

Posted by Gomesh on Mon, 03 Jan 2022 02:17:39 +0100

Seven sort algorithms and comparison

Sort, also known as Sort Algorithm, is the process of sorting a set of data according to a specified message. Sorted classification: 1) Internal sorting: means that all data that needs to be processed is loaded into internal memory for sorting. Internal sorting includes insert sort (direct insert or Hill sort), select sort (simple sort and heap ...

Posted by postalservice14 on Mon, 03 Jan 2022 01:37:09 +0100

Minimum path covering and minimum chain covering Dilworth theorem: minimum chain covering is equal to the longest inverse chain (detailed proof and classical examples)

1, Minimum path coverage definition Minimum path covering means that in a directed acyclic graph, all points in the graph are covered with the least and disjoint simple paths. solution ① Disassemble each point in the original drawing (disassemble point u into U and u+n); ② Set each edge < u, V > in the original graph to the correspond ...

Posted by hotcigar on Mon, 03 Jan 2022 00:57:13 +0100

Dictionary tree (prefix tree)

Dictionary tree (prefix tree) summary: The dictionary tree (Trie) is used to determine whether a string exists or has a string prefix. Why do we need a dictionary tree to solve this kind of problem? If we have a dictionary that stores nearly 10000 words, even if we use hash, the actual cost of searching for a word in it is very lar ...

Posted by raker7 on Sun, 02 Jan 2022 23:51:42 +0100

c + + freshman basic information statistics software

catalogue Basic software functions: 1. Enter new student's personal information 2. Newly added information 3. Delete all information according to the new student's name 4. Display the new student information that has been entered and added ​ 5. Search for information by student's name 6. Ranking from high to low according to the fre ...

Posted by heshan on Sun, 02 Jan 2022 22:02:47 +0100

Chapter 9 - linear table lookup

lookup The definition of search is the process of finding the element with keyword k in the data structure storing several elements. If the table is modified during the lookup process, it is called a dynamic lookup table, otherwise it is a static lookup table. PI is the probability of finding the ith element in the table, ci is the number of ...

Posted by Johnain on Sun, 02 Jan 2022 21:09:55 +0100

Data Structure Course Set Individual Direct Insert Sorting

Description of the problem: For sequentially stored linear tables (assuming the sequential table is not empty), use vector s or arrays to insert the sorting algorithm directly and output the sorting results for each trip. Reference function prototype: (vector version) //Insert Sort directly template<class ElemType> void Simple ...

Posted by heepofajeep on Sun, 02 Jan 2022 19:12:36 +0100

Data structure and algorithm - sorting algorithm

Data structure and algorithm tree Previous contents 1 - linked list 2-stack and queue 3-string 4-tree 5-fig 8-sort 9 - query 6-greedy algorithm 7-recursion and divide and conquer 10 - dynamic programming 11-STL Library Common sorting algorithms Unstable algorithms: quick sort, Hill sort, selective sort, heap sort 1. Bubble sortin ...

Posted by iman121 on Sun, 02 Jan 2022 19:09:50 +0100

1. KMP string matching

1, Definition A string is a finite sequence of characters from the alphabet ΣS = a0a1a2...an-1 ∈ ∑*Features: there are not many types of characters that make up a string, but the string length may be much larger than the character typesterm Equal: if the length is equal and the corresponding characters are the same (S[i] = T[i]), then ...

Posted by lukesb on Sun, 02 Jan 2022 19:07:53 +0100

Leetcode question brushing diary: 11-15 questions

brief introduction The author graduated from Xi'an Jiaotong University in 2021 and will continue to study postgraduate in this university in September of the same year. After experiencing the intense and exciting job search process of some students around him, the 60w + offer and 30w offer are greatly related to his ability to tear the cod ...

Posted by malikah on Sun, 02 Jan 2022 14:29:47 +0100