LeetCode brush notes binary tree binary search tree properties

Introduction to binary search tree Binary search tree (BST) is a special binary tree: for each parent node, the value of its left child node is less than or equal to the value of the parent node, and the value of its right child node is greater than or equal to the value of the parent node. Therefore, for a binary lookup tree, we can find out ...

Posted by markthien on Thu, 18 Nov 2021 19:53:01 -0800

This article takes you through the tower of Hanoi and its deformation problems

Ordinary Hanoi Tower Interested children's shoes can contact and communicate with me~ Official account: swim the code sea more high quality original articles are inside! The Tower of Hanoi is a mathematical problem based on a legend: There are three poles A, B and C. There are N (N > 1) perforated discs on rod A, and the size of the ...

Posted by markbm on Thu, 18 Nov 2021 16:29:50 -0800

ACwing Chapter 3 search and graph theory

1, DFS There are two important concepts in DFS: backtracking and pruning When the weight of all edges in the graph is 1, the BFS must find the shortest path When tracing back, we must pay attention to restoring the scene Arrange numbers #include<iostream> using namespace std; const int N = 10; int n; int path[N];//Record all search p ...

Posted by _OwNeD.YoU_ on Thu, 18 Nov 2021 05:30:57 -0800

Super star MOOC learning pass high level language programming C + + experiment 02 branch and loop programming of Jilin University (level 2021)

five   Einstein ladder Title No.: Exp02-Basic10,GJBook3-04-15 Title: Einstein ladder Problem Description: there are steps. I don't know the number, but I know: each step spans 2 steps, and there is 1 step left at the end; Each step spans 3 steps, and there are 2 steps left at last; Each step spans 5 steps, and finally there are 4 ...

Posted by Pandolfo on Thu, 18 Nov 2021 04:05:51 -0800

Luogu P1113 chores (DP, topology sorting)

[Title Description] John's farm has a lot of chores to complete before milking the cows. Each chore takes a certain amount of time to complete it. For example, they have to gather the cows, drive them into the barn, wash their breasts and do some other work. It is necessary to finish all the chores as soon as possible, because there is more tim ...

Posted by cjl on Wed, 17 Nov 2021 17:04:04 -0800

Underlying principle of C++ string

1, Deep and shallow copy Shallow copy: When implementing a string, if you do not copy the string first, a copy constructor will be automatically generated, but it is only a shallow copy. Two string objects point to the same address. When two objects call the destructor, the destructor called by the previous object has released the internal sla ...

Posted by magicmoose on Wed, 17 Nov 2021 08:28:58 -0800

C-3: draw a colored pyramid and add a lighting effect

Operation requirements: a. The side length of the pyramid is 2; b. The color of each vertex of a pyramid is different; c. The center of the pyramid is (1,2,3); d. It is required to use a variety of lights, including ambient light, specular light and scattered light, which can be reflected by controlling the object Material factors and ...

Posted by jase01 on Wed, 17 Nov 2021 08:12:54 -0800

Halcon Blob analyzes the segmentation and reads the number on the beer bottle -- bottle.hdev

introduction 1, Results 1.1 reading images 1.2 after blob analysis 2, Halcon code * * bottle.hdev: Segment and read numbers on a beer bottle * * Step 0: Preparations * Specify the name of the font to use for reading the date on the bottle. * It is easiest to use the pre-trained font Industrial_0-9_NoRej. If you * have run ...

Posted by multe-media on Wed, 17 Nov 2021 02:21:46 -0800

Detailed explanation of linked list (single linked list, circular linked list, two-way linked list, Linux kernel "shared" double linked list) C/C++

The complete code of single linked list, circular linked list, two-way linked list and Linux kernel "shared" double linked list is attached at the end of the article catalogue 1, Detailed explanation of linked list principle 2, Implementation of single linked list algorithm 2.1 concept of single linked list   2.2 single link ...

Posted by jbradley04 on Tue, 16 Nov 2021 20:49:42 -0800

[C + +] template (simple and detailed)

Template 1 1. Why use templates? One of the most important features of C + + is code reuse. In order to realize code reuse, the code must be universal. Common code needs to be independent of data types and can automatically adapt to changes in data types. This type of programming is called parametric programming.    therefore, C ...

Posted by LoganK on Tue, 16 Nov 2021 08:15:35 -0800