Practical summary of C + + sort() function

0. Preface When brushing leetcode, the sort function is a commonly used method. It has not systematically summarized the usage before, resulting in that the code writing is not smooth enough every time and slows down the speed of understanding questions. Therefore, I decided to summarize the usage of the sort() function and take notes to de ...

Posted by Dimwhit on Mon, 10 Jan 2022 19:53:02 +0100

Sorting API problem

Sorting API 1. Static sorting API in arrays class **Arrays. Sort (data type [] a) uses quick sort, and the time complexity is O(nlogn) Sorts the specified array of types in ascending numerical order. instable Arrays.sort(T[],Comparator<? super T> c) ,Arrays.sort(Object[] a) The specified object array is sorted according to ...

Posted by markthien on Mon, 10 Jan 2022 18:02:29 +0100

Generate window maximum array

Generate the maximum array of windows (priority queue, monotone queue) Problem Restatement: Give you an integer array arr, with a sliding window of size w moving from the leftmost side of the array to the rightmost side of the array. You can only see k numbers in the sliding window. The sliding window moves only one bit to the right at a time ...

Posted by wakenbake on Mon, 10 Jan 2022 17:41:29 +0100

[beginner's line segment tree, this article must be right] line segment tree (single point modification and interval modification) acm winter vacation training diary 22 / 1 / 10

Segment tree Segment tree is a data structure commonly used to maintain interval information in algorithm competition. It is a basic and important data structure that an ACMer needs to master. The segment tree can realize single point modification, interval modification, interval query (interval summation, interval maximum value, minimum value ...

Posted by bnownlater on Mon, 10 Jan 2022 15:36:12 +0100

Data structure and linear table

Chapter I overview Section I overview of data structure Data structure is a programming discipline that studies non numerical calculation. Nicklaus Wirth, the father of Pascal who won the Turing Award, put forward a famous formula: Algorithm + data structure = Program Data structure is a way for computers to store and organize data. A data ...

Posted by Matth_S on Mon, 10 Jan 2022 12:33:48 +0100

Sword finger Offer 35 Replication of complex linked list (java implementation, in-situ modification solution)

Let's start with: Please implement the copyRandomList function to copy a complex linked list. In a complex linked list, each node has a next pointer to the next node and a random pointer to any node or null in the linked list. Example 1: Input: head = [[7, null], [13, 0], [11, 4], [10, 2], [1, 0]] Output: [7, null], [13, 0], [11, 4 ...

Posted by numtre on Sun, 09 Jan 2022 23:07:07 +0100

The 19th day of working hard to become a programmer

Today, I was oncall again. Although things are simple, dealing with people's emotions really affects their mood. Adjust the negative emotions, calm down to listen to the class and brush the questions. Speaking about double pointers today, the idea and implementation are relatively simple. Study notes: 1.167. Sum of two II - input ordered arra ...

Posted by ConcreteDJ on Sun, 09 Jan 2022 15:58:46 +0100

Data structure -- sequential table (array) topic

Array of related interview questions Click to enter > > Remove element (LeetCode) Give you an array num and a value val. you need to remove all elements with a value equal to Val in place and return the new length of the removed array. Instead of using extra array space, you must use only O(1) extra space and modify the input arr ...

Posted by Valord on Sun, 09 Jan 2022 15:10:09 +0100

Fundamentals of SAR signal processing pulse compression / matched filtering

Pulse compression / matched filter is one of the most basic operations of radar signal processing. This paper deduces the basic principle of matched filter in detail, and gives the simulation program of matlab. Because there are too many formulas, we share them here in the form of screenshots. If you need word or pdf, you can leave a message o ...

Posted by waterox on Sun, 09 Jan 2022 14:37:59 +0100

Summary of problem solutions for single week competition on January 9, 2022

T1 5976. Check whether each row and column contain all integers For a matrix of size n x n, if each row and column contains all integers from 1 to n (including 1 and N), the matrix is considered to be an effective matrix. Give you an integer matrix of size n x n, please judge whether the matrix is a valid matrix: If yes, return true; Otherwis ...

Posted by fcaserio on Sun, 09 Jan 2022 13:51:20 +0100