[data structure] binary tree
Concept and structure
Basic concepts of binary tree
A binary tree is a finite set of nodes, which: 1. Null 2. It is composed of a root node and its left and right subtrees As can be seen from the above figure: 1. The binary tree does not have nodes with a degree greater than 2 2. The subtree of a binary tree can be divided into left and ...
Posted by dsaba on Sat, 25 Dec 2021 20:25:09 +0100
Java daily question -- > sword finger Offer II 030 Insert, delete, and random access are all O's containers
This is [030 on LeetCode. Insert, delete and random access are O(1) containers], and the difficulty is [medium]
subject
Design a data structure that supports the following operations under the average time complexity O(1):
insert(val): returns true when the element val does not exist, and inserts the item into the collection; otherwise, retu ...
Posted by Stressed on Sat, 25 Dec 2021 17:54:50 +0100
Introduction to leetcode 21 day dynamic planning -- climbing stairs from 0 to 0.5 [Day02]
Introduction to leetcode 21 day dynamic planning -- climbing stairs from 0 to 0.5 [Day02]
Write in front
Then in the last article, today Xiaofu ran up and down around the school built around the mountain, in order to eat shrimp dumplings with good taste. After all, today is the winter solstice. I hope all friends can also eat delicious dumpli ...
Posted by R0d Longfella on Sat, 25 Dec 2021 17:03:28 +0100
Big talk data structure - Search
1. Ordered table lookup
-Binary search
The premise of binary search is that the records in the linear table must be in order of key codes (usually from small to large), and the linear table must be stored in order.
/*Binary search*/
int Binary_Search(int *a, int n, int key)
{
int low, high, mid;
low = 1; /*The lowest subscript of the ...
Posted by visualed on Sat, 25 Dec 2021 15:38:25 +0100
PAT class a summary
PAT class a summary - Beginner Level
1, Mathematics
It is often used as a basic 20 point sub topic in PAT. The change of the topic is relatively novel, but the basic idea remains the same.
1.1 prime
Egyptian screening method: to obtain all primes within natural number n, the multiples of all primes not greater than root n must be eliminated ...
Posted by sissy on Sat, 25 Dec 2021 14:42:15 +0100
2021 Niuke multi school 7 f. xay love trees (Chairman tree + DFS sequence)
Question meaning: for a tree with two n points, find the largest subset and meet the following conditions:
The point set is a continuous chain on tree 1The points are set on tree 2 without any ancestral relationship
Idea:
For condition 2:
If point u is the ancestor of point v, then the subtree of u must contain V, that is, it must contain t ...
Posted by Confusion101 on Sat, 25 Dec 2021 14:05:25 +0100
Single chip microcomputer -- heart rate detection item
1 Introduction
Hi, everyone, this is senior Dancheng. Today I'd like to introduce a single chip microcomputer project made by senior students
Design and implementation of blood oxygen and heart rate detector based on STM32
It can be used in curriculum design or graduation design
Technical solutions
Design help:<Q>746876041
2 main d ...
Posted by Dilb on Sat, 25 Dec 2021 10:43:00 +0100
Deep learning image classification of small data set based on KERAS in R language
Original link: http://tecdat.cn/?p=6714Original source: Tuo end data tribal official accountIt is common that image classification models must be trained with very little data, which may be encountered in practice if you conduct computer vision in a professional environment. "Few" samples can represent anywhere from hundreds to tens o ...
Posted by utherwun on Sat, 25 Dec 2021 10:29:59 +0100
Summary of common input problems under c/c + +
Summarize the common input formats and processing methods in the algorithm test to prevent the occurrence of obvious algorithms. However, due to the poor processing of input problems, the questions were not answered. I fell on this problem.
1, Similarities and differences of several commonly used input functions
1. scanf()
You need to includ ...
Posted by sloppstack on Sat, 25 Dec 2021 08:11:47 +0100
Several common solutions to Hash conflicts when using Hash tables
Hash table
Such as HashMap in Java, a (K,V) data storage structure. The bottom layer of HashMap uses array + linked list, mainly array, not all hash tables.
When adding an element to the hash table, get a hash value from the key of the element through a specific hash function and calculate the storage location stored in the current array.
Ha ...
Posted by Edward on Sat, 25 Dec 2021 08:05:58 +0100