Let's look at a very interesting passage first
One day Xiao Ming went to the library to borrow N books. When he got out of the library, the alarm sounded, so the security guard stopped Xiao Ming to check which book was not registered for lending. Xiao Ming is going to pass each book under the alarm to find out the book tha ...
Posted by kindoman on Wed, 22 Dec 2021 06:25:42 +0100
1. Process S (line segment)
1.1 train of thought analysis
The processing of S is relatively simple. We split it horizontally. The original trapezoid remains as an upper trapezoid without degradation:
Here, we focus on the merging trapezoid (Trim Wall). The author's splitting idea is as follows:
Merge from left to right; That is, th ...
Posted by jroscoe on Wed, 22 Dec 2021 06:20:30 +0100
Receive a string of message characters from the keyboard and output the corresponding Huffman code. At the same time, it can translate the code string generated by Huffman code and output the corresponding message string.
(1). Construct a Huffman tree;
(2). Implement Huffman coding and d ...
Posted by slobodnium on Wed, 22 Dec 2021 03:16:35 +0100
1, Some concepts
1. Bipartite diagram
It must not contain odd rings, but may contain rings with even length, not necessarily connected graphsBipartite graph is a special model in graph theory. Let G=(V,E) be an undirected graph. If vertex v can be divided into two disjoint subsets (A,B), and the two vertices i and j associated with each e ...
Posted by raj86 on Wed, 22 Dec 2021 00:25:55 +0100
Given an array containing n ， positive integers and a positive integer target.
Find out the continuous sub array [numsl, numsl + 1,..., numsr-1, numsr] with the smallest length satisfying its sum ≥ target in the array, and return its length. If there is no eligible subarray, 0 is returned.
Input: target = 7, N ...
Posted by ashben on Tue, 21 Dec 2021 22:55:41 +0100
Taking CSDN as a learning note has no commercial use. I hope to communicate with you and make progress together. Learning materials are from Github: link
Modules and functions
Functions referenced in Github source program
from numpy import *
Text file processing
Helen appointment text file datingTestSet2.txt Becau ...
Posted by vmavrou on Tue, 21 Dec 2021 18:29:11 +0100
1. Experimental purpose
(1) Understand the disk structure and how the data on the disk is organized. (2) Master the calculation method of disk access time. (3) Master common disk scheduling algorithms and their related characteristics.
2. Basic knowledge and principle of experiment
(1) Organization of disk data Each physical record on the di ...
These three sorts have two-layer cycles, which is their superficial feature. I call the external cycle large cycle and the internal cycle small cycle. Their basic idea of algorithm is the same, that is, the sequence to be sorted is divided into disordered interval and ordered interval. Each large cycle can increase the ordered interval and r ...
Posted by Felex on Tue, 21 Dec 2021 16:54:23 +0100
Chapter X internal sorting
Linear table operation
Union of unordered linear tables:
For example: A = (17, 55, 9, 30, 28)
B = (30，68，5，17)
Time complexity O(LA*LB)
Union of ordered linear tables:
For example: A = (7, 15, 29, 38)
B = (3，7，46，57)
Time complexity O(LA+LB)
Sequential lookup of unordered tables: O(n)
Posted by RazorICE on Tue, 21 Dec 2021 13:23:42 +0100