This paper understands three traversal methods of binary tree
Focus on official account: high performance architecture exploration. The background replies to [data], which can be collected free of charge
As the saying goes: learning is like sailing against the current. If you don't advance, you will retreat; The heart is like a horse on the plain, easy to put but difficult to collect. This sentenc ...
Posted by Senate on Sat, 18 Dec 2021 02:14:52 +0100
Do you know red and black trees? Tell you a different red and black tree and say something interesting!
Let's first look at the following two questions:
Question 1. Can the key values of the red black tree be repeated? Question 2. Must the red black tree have a key value?
There are many introductions about red and black trees on the Internet, and red and black trees are also widely used. Ask Du Niang. She will tell you all kinds of implementati ...
Posted by xylex on Fri, 17 Dec 2021 00:06:46 +0100
3010 calculation of binary tree height based on binary linked list (with ideas, a possible case and code of WA)
Calculation of binary tree height based on binary linked list
describe
Let the elements of each node in the binary tree be one character, establish a binary linked list in the order of first-order traversal, and write a recursive algorithm to calculate the height of the binary tree.
input
...
Posted by laurus on Wed, 10 Nov 2021 14:52:36 +0100
LeetCode - problem solving notes - 109 - 0109. Convert Sorted List to Binary Search Tree
Solution 1
The question is 0108. Convert Sorted Array to Binary Search Tree It is possible to directly use the divide and conquer tree idea of finding the middle position as the root node in the previous question, which is to solve the method of determining the middle position in the linked list.
[refer to the official] the method to find the ...
Posted by webmasternovis on Tue, 02 Nov 2021 14:09:00 +0100
Heap and heap sorting
The previous blog post roughly described the implementation of priority queue. This one will talk about heap and heap sorting. For priority queue, please refer to the following blog post. Detailed explanation of binary heap and implementation of priority queue
  ...
Posted by jlryan on Fri, 29 Oct 2021 07:11:30 +0200
Learning notes of data structure, algorithm and application - C + + language description - competition tree
1, Winner tree
Suppose n players take part in a tennis match. The rule of the game is "sudden death": as long as a player loses a game, he will be eliminated. A pair of players play one-on-one, and finally only one player remains unbeaten. We use binary tree to describe the game process. Each external node represents a player, ea ...
Posted by excence on Sat, 25 Sep 2021 12:59:48 +0200
Introduction to tree structure of java data structure
1. Tree structure
Is an abstract data type or a data structure that implements this abstract data type, which is used to simulate a data set with tree structure. It has the following characteristics:
①Each node has zero or more child nodes;
②A node without a parent node is called a root node;
③Each non root node has only one parent node; ...
Posted by ashishag67 on Tue, 21 Sep 2021 21:22:38 +0200