Summary of single linked list routine

21. Merge two sequential tables Input: l1 = [1,2,4], l2 = [1,3,4] Output: [1,1,2,3,4,4] There is nothing to say about using an empty node. class Solution: def mergeTwoLists(self, l1: ListNode, l2: ListNode) -> ListNode: dummy = ListNode() p = dummy while l1 and l2: if l1.val < l2.val: ...

Added by twister47 on Tue, 15 Feb 2022 15:56:13 +0200

Array: question brushing record

Overview of knowledge points:     1. Sum of two numbers: Given an integer array , nums , and an integer target value , target, please find the , and the , integers with the target value , target , in the array and return their array subscripts. You can assume that each input will correspond to only one answer. However, the same e ...

Added by cuvaibhav on Tue, 15 Feb 2022 15:34:49 +0200

[ACWing algorithm basic course]: Chapter 5 - dynamic programming

Knapsack problem ★★★ (1) 0-1 knapsack problem (1 for each item) Topic introduction sample input 4 5 1 2 2 4 3 4 4 5 output 8 [version 1] two dimensional state definition of 0-1 knapsack problem f[i][j]: select only the first I items with total volume < = Max of J State analysis (1) When the current backpack capacity is insuf ...

Added by dast on Tue, 15 Feb 2022 14:15:19 +0200

Discrete mathematics experiment II

Experimental topic: solution of spanning tree, loop space and fault set space Purpose of the experiment: 1. Master the solution method of undirected connected graph spanning tree; 2. Master the solution method of basic loop system and loop space; 3. Master the solution method of basic cut set system and fault set space; 4. Understand the prac ...

Added by amjohnno on Tue, 15 Feb 2022 12:12:35 +0200

Niuke video summary 2 (brief introduction to Dutch flag problem, classic / random fast sorting, heap sorting and heap)

Niuke video summary 2 Double pointer problem Task 1: sort left and right Given an array arr and a number num, please put the number less than or equal to num on the left of the array and the number greater than num on the right of the array. Additional space complexity required O ...

Added by jwbworks on Tue, 15 Feb 2022 10:53:39 +0200

Pairwise algorithm for software test case design

Pairwise algorithm Pairwise was first proposed by L. L. Thurstone (29 may 1887 – 30 September 1955) in 1927. He is an American psychostatistician. Pairwise is also the product based on mathematical statistics and the optimization of the traditional orthogonal analysis method. In the test process, test cases are organized for the case of ...

Added by lukegw on Tue, 15 Feb 2022 10:28:27 +0200

Minimum spanning tree and bipartite graph in graph theory (acwing template)

Directory navigation: Minimum spanning tree: For a graph with n points, the edges must be greater than or equal to n − 1. The minimum spanning tree is to select from these edges N-1 edges connect all n points, and the sum of edge weights of these n − 1 edges is the smallest of all schemes One more thing: There are n ...

Added by Crave on Tue, 15 Feb 2022 05:56:21 +0200

LeetCode algorithm, daily question, impact Alibaba, day4

1,LeetCode 344. Reverse string subject Write a function that inverts the input string. The input string is given in the form of character array char []. Do not allocate additional space to another array. You must modify the input array in place and use the additional space of O(1) to solve this problem. You can assume that all char ...

Added by cbrian on Tue, 15 Feb 2022 02:05:39 +0200

Python white OpenCV learning class from scratch - 8 Frequency domain image filtering

Completed today: [100 OpenCV routines] 100 Adaptive local noise reduction filter Celebration and change: Python white OpenCV learning class from scratch - 8 Frequency domain image filtering (I) Welcome to pay attention "100 routines" Series, continuously updating Welcome to pay attention "Python Xiaobai's OpenCV learning course ...

Added by srirangam007 on Tue, 15 Feb 2022 01:06:12 +0200

Random number generator of Gaussian distribution

Random number generator of Gaussian distribution The implementation process is to first find the blog of the implementation of relevant Gaussian random numbers in vivado, first get a general understanding, and then go to HowNet to find the relevant master's thesis, summarize the simplest implementation method of Gaussian random number generati ...

Added by ikscovski on Mon, 14 Feb 2022 14:21:11 +0200