Puge algorithm dichotomy

Dichotomy? 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

Point positioning: how to split and update ladder diagram and binary search structure ·: Processing S(Update trapezoidal map and search structure in point location)

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

Coding and compiling of messages

Content: 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. Design requirements:   (1). Construct a Huffman tree;   (2). Implement Huffman coding and d ...

Posted by slobodnium on Wed, 22 Dec 2021 03:16:35 +0100

[graph theory] find a girlfriend with Hungarian algorithm (great victory of pure love party)

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

Sorting (implemented in C language)

catalogue 1. Sorting and classification 2. Insert sort 2.1 direct insertion sort 2.2. Shell Sort 3. Select Sorting 3.1 selection and sorting 3.2. Heap sort 4. Exchange sorting 4.1 bubble sorting 4.2 quick sort 4.3 quick sort non recursive ​5. Merge sort 5.1 merge sort 5.2 merge sort non recursive 6. Non comparative sorting 6.1 ...

Posted by revdev on Tue, 21 Dec 2021 23:36:45 +0100

Sword finger offer_008 and the shortest subarray greater than target

Title: 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. Example 1: Input: target = 7, N ...

Posted by ashben on Tue, 21 Dec 2021 22:55:41 +0100

AiLearning Kapitel 2 k-nearest neighbor algorithm (dating website)

preface 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 * import operator Text file processing Helen appointment text file datingTestSet2.txt Becau ...

Posted by vmavrou on Tue, 21 Dec 2021 18:29:11 +0100

Experiment 7 Simulation and implementation of disk scheduling algorithm

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 ...

Posted by gfX on Tue, 21 Dec 2021 16:55:48 +0100

All ❤️ Two layer cycle ❤️ How to distinguish between bubble sorting, selection sorting and insertion sorting

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

Learning notes: Chapter 10 internal sorting

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) lookup Sequential lookup of unordered tables: O(n) ...

Posted by RazorICE on Tue, 21 Dec 2021 13:23:42 +0100