Traversal of DS-Chapter V-Binary Trees

Summary of data structure binary tree traversal ⭐⭐⭐ The concept of binary trees 1. The feature is that each node has at most two subtrees, left subtree and right subtree. 2. Full Binary Tree: i<=n/2 Round down, I is preceded by non-leaf nodes, I is followed by leaf nodes (1) If n is odd, every non-leaf node has left and right childr ...

Posted by Easter Bunny on Fri, 19 Nov 2021 10:06:20 -0800

Data structure and arithmetic tree

Basic definition of tree A tree is a set with hierarchical relationship composed of n (n > = 1) finite points. Characteristics of trees Each node has 0 or more child nodesA node without a parent node is called a root nodeEach non root node has only one parent nodeEach node and its descendants can be regarded as a tree as a whole, which is ...

Posted by Black Rider on Fri, 19 Nov 2021 08:09:54 -0800

Bellman Ford algorithm and example java code template

matters needing attention: If there is a negative weight loop in the diagram, there is not necessarily the shortest circuit. Because if the infinite loop in the negative weight loop finally comes out, the shortest path is negative infinity. For example, the following figure: But what we said above is that if there is a negative weight loop ...

Posted by sqishy on Fri, 19 Nov 2021 02:39:43 -0800

❥ top ten sorting algorithms ❥ 20000 word nanny tutorial (text analysis + illustration + code implementation + example)

What is an algorithm? At ordinary times, children who study computer often hear the word algorithm. What is an algorithm? There is no clear definition of the algorithm. According to my personal understanding, the algorithm is to solve a specific problem and describe the ideas and steps of solving the problem. In fact, there are many ar ...

Posted by ledtear on Fri, 19 Nov 2021 00:46:36 -0800

Optimal threshold for end of period forecast (202012-2) (50 points + 100 points)

Problem description Question No.:202012-2Test title:Optimal threshold of period end forecasttime limit:1.0sMemory limit:512.0MBProblem Description: Topic background Considering that the safety index is an integer in a large range and the side dishes are likely to be confused about whether they are really safe, Dunton decided to set a threshold ...

Posted by brokencode on Thu, 18 Nov 2021 21:38:46 -0800

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

NOIP-2011-J1-real problem analysis

1, Multiple choice questions 1. B. basic problem, investigate binary operation 2. B, basic question, 48 + 9 = 57 3. C, basic questions, storage space calculation, 8GB/2MB=8*1024/2=4096 4. C, basic questions, basic computer knowledge, Moore's law 5. B. according to the meaning of the question, any two of the seven vertices have exactly one edge ...

Posted by Zomie on Thu, 18 Nov 2021 16:44:31 -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

Binary tree (primary)

Catalogue of series articles Preorder traversal: Root - > left - > right Middle order traversal: left - > root - > right Post order traversal: left - > right - > root 1, Middle order, pre order and post order traversal Middle order traversal of binary tree: traverse the tree by accessing the left subtree - root nod ...

Posted by LostKID on Thu, 18 Nov 2021 07:33:52 -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