LeetCode brush notes double pointer sliding window
sliding window
Sliding window: if two pointers point to the same linear table, the traversal direction is the same, and the starting points of the two pointers are different, a sliding window will be formed. The two pointers move with different strategies until the values of the two pointers are equal or meet other special conditions.
76 mini ...
Posted by yoda69 on Sun, 05 Dec 2021 06:37:06 +0100
ROS-3DSLAMlvi-sam Source Code Read 10
2021SC@SDUSC
(12) lvi-sam source code read 10 - visual_loop Reading 3 + ORB learning
visual_loop
DUtils Folder
DException
Define exception information
Timestamp
//Member variables
/// Seconds
unsigned long m_secs; // seconds
/// Microseconds
unsigned long m_usecs; // microseconds
//Main methods
setTime //Set time stamp
...
Posted by Reviresco on Sat, 04 Dec 2021 19:01:09 +0100
C + + object oriented programming Tan Haoqiang Chapter 7 after class questions
1. Enter the three sides a, B and C of the triangle. The formula for calculating the area of the triangle is area=
s=(a+b+c)/2 the conditions for forming a triangle are: a + b > C, B + C > A, C + a > B
Write a program, input a, B and C, and check whether a, B and C meet the above conditions. If not, cerr will output relevant error ...
Posted by DaveEverFade on Sat, 04 Dec 2021 06:20:44 +0100
Conditional variables of C + + - thread synchronization Foundation
Thread synchronization Basics
In concurrent scenarios, sometimes we don't just want to protect data. We also want to synchronize some operations between multiple threads, such as waiting for a condition to be true or executing some operations when an event occurs. The C + + standard library provides condition variables and futures; Concurrency ...
Posted by townclown on Sat, 04 Dec 2021 05:07:30 +0100
[advanced data structure] [algorithm notes] segment tree
Segment tree
Introduction: segment tree is a data structure commonly used in algorithm competition to maintain interval information.
The segment tree can realize single point modification, interval modification, interval query (interval summation, interval maximum and interval minimum) within the time complexity of O(logN).
The article only ...
Posted by fluteflute on Fri, 03 Dec 2021 19:00:07 +0100
String matching algorithm KMP algorithm
1, Violence solving
We can write different violence solving codes, and the subsequent improved versions are based on these two versions of codes.
1. Realize
This solution is easy to understand. We use two pointers to track the text string and the pattern string, respectively. If the matching is successful, the two pointers are incremente ...
Posted by zild1221 on Fri, 03 Dec 2021 16:17:02 +0100
[course assignment] address book management system. I don't know how to write the course assignment. Come quickly
order
Some people will never be together in this life, but there is a feeling that can be hidden in their heart and kept for a lifetime.
Hi, this is fox~~
I haven't seen you for a few days. I went out the day before yesterday. I rested for a day and began to work hard today. Time really flies. 2021 will pass in the twinkling of an eye. I d ...
Posted by Arc on Fri, 03 Dec 2021 13:41:32 +0100
[LeetCode daily question] [December 3, 2021] 1005. Maximum array sum after K inversions
1005. Maximum array sum after K negations
LeetCode: 1005. Maximum array sum after K negations
simple
single
\color{#00AF9B} {simple}
simple
Give you an integer array nums and an integ ...
Posted by fogofogo on Fri, 03 Dec 2021 07:08:56 +0100
C++ Concurrency and Multithreading
Preface
C++ Concurrency
Reference courses: https://www.bilibili.com/video/BV1Yb411L7ak?p=4&spm_id_from=pageDriver
Reference Notes: https://blog.csdn.net/qq_38231713/category_10001159.html
My previous notes (modern C++ tutorial notes (next)): https://zhuanlan.zhihu.com/p/415910318
1. Processes and Threads
Narrowly, each process (th ...
Posted by wattsup88 on Wed, 01 Dec 2021 22:11:41 +0100
c++11 multithreaded programming (IV) -- dead lock
deadlock
If you lock a mutex but do not release it, a deadlock will occur when another thread accesses the resources protected by the lock. In this case, use lock_guard can ensure that the lock can be released when destructing. However, when an operation needs to use two mutually exclusive elements, only lock is used_ Guard does not guarantee ...
Posted by betman_kizo on Wed, 01 Dec 2021 19:58:23 +0100