Title Link: [minimum interception system]
General meaning:
One shell of the interception system can reach any height to intercept enemy missiles, but this shell can not exceed the previous height in the future, that is, it can not intercept missiles higher than him again. Then give some missiles and ask how many interception systems are ne ...
Posted by mrheff on Tue, 17 May 2022 12:49:43 +0300
Reverse the order of strings, taking the string abcdef as an example
1. With additional arrays
#include <stdio.h>
#include <string.h>
int main() {
char str[] = "abcdef";
//Find the size of the string, including '\ 0'
int sz = strlen(str) + 1;
//Dynamic memory allocation, apply for a character array of sz size
...
Posted by zechdc on Tue, 17 May 2022 03:07:02 +0300
The questions are as follows:
Give you a string s and a string t. Returns the smallest substring in s that covers t all characters. If there is no substring covering t all characters in s, the empty string "" is returned.
be careful:
For repeated characters in T, the number of characters in the substring we are looking for must not ...
Posted by subalan on Tue, 17 May 2022 02:00:21 +0300
1, Run length encoding
The idea behind this data compression method is: if a data item d appears n times continuously in the input stream, replace n times with a single pair of nd. Then, the continuous occurrence of a data item is called run length N, and this method of data compression is called run length coding or RLE. We first apply ...
Posted by Quevas on Mon, 16 May 2022 22:50:47 +0300
Goal
In this tutorial,
We will learn how the Haar cascade object detection works. We will see the basics of face detection and eye detection using the Haar Feature-based Cascade Classifiers We will use the cv::CascadeClassifier class to detect objects in a video stream. Particularly, we will use the functions: cv::CascadeClassifier::load to l ...
Posted by jimiwa on Mon, 16 May 2022 20:38:05 +0300
1 Title: shopping list
Xiao Ming has just found a job. The boss is very nice, but the boss's wife loves shopping. When the boss is busy, he often asks Xiao Ming to help him go shopping in the mall. Xiao Ming is very bored, but it's hard to refuse.
see, XX The big promotion is coming again! The boss's wife issued a long shopping list with disc ...
Posted by madrazel on Mon, 16 May 2022 14:17:30 +0300
Overview
Reference for this article: https://blog.jcoglan.com/2017/02/12/the-myers-diff-algorithm-part-1/
Every developer has been exposed to the diff function of git to some extent, as shown below:
This function can display the modification information of a certain file, which is very convenient for the daily development of developers ...
Posted by hcdarkmage on Mon, 16 May 2022 12:55:33 +0300
General idea of the topic
There are N examination rooms, each with K candidates. Now give the admission number and score of candidates in each examination room. It is required to sort all candidates from high to low, and output the admission number, ranking, examination room number and ranking of all candidates in order.
Algorithm idea
This is ...
Posted by zszucs on Mon, 16 May 2022 06:27:59 +0300
https://en.wikipedia.org/wiki/Quicksort
Quick sort
Principle: partition continuously by comparing the median value (pivot), until all intervals reach the minimum (capacity is 1), and the result is orderly; When performing the comparison operation, it is the comparison operation from low to high, and the sorting is realized by continuously rem ...
Posted by baldwinw on Sun, 15 May 2022 16:57:15 +0300
https://en.wikipedia.org/wiki/Merge_sort
Merge sort
Principle: using the idea of divide and conquer and recursion, first split the data into the smallest unit, then merge and sort from the smallest unit, and gradually merge the small partition into the largest partition;
The merge sort algorithm does not belong to the in place sort algorithm ...
Posted by chasiv on Sun, 15 May 2022 16:19:44 +0300