In 2021, specially inserted candidates carefully sorted out the notes of computer foundation and data structure

Must do problem sorting At 21:40 on April 11, 2021, I was very skeptical about life after the exam. I originally wanted to rely on professional courses to score points. I also expected that there would be a large number of applicants for specialized courses this year. In addition, the reform of professional courses should be simpler, but I did ...

Added by KingIsulgard on Tue, 08 Mar 2022 13:26:58 +0200

Binary tree sequence and deserialization summary python C++

preface In the actual interview, we will not define the node class of the binary tree for you like Li Kou. We need to convert the input data into the data structure required by the topic. The main corresponding knowledge points are the serialization and deserialization of the binary tree, which can be used for reference Force buckle 297 ...

Added by virgil on Fri, 04 Mar 2022 00:00:45 +0200

Binary tree arrangement 2

1. Find the minimum depth of binary tree First, understand the concept of minimum depth: minimum depth is the number of nodes on the shortest path from the root node to the nearest leaf node., Note the leaf node. If so, the branch without left child will be regarded as the shortest depth. Therefore, if the left subtree is empty and the right s ...

Added by realjumper on Tue, 01 Mar 2022 16:16:14 +0200

LeetCode brush notes binary tree path sum

112 path sum Given a binary tree root and a value sum, judge whether there is a path where the sum of node values from the root node to the leaf node is equal to sum. Enter a binary tree and a given integer, and output a Boolean value to indicate whether there are paths that meet the conditions. Input: root = [5,4,8,11, null, 13,4,7,2, nu ...

Added by kat89 on Mon, 28 Feb 2022 14:18:07 +0200

Binary tree level traversal: two-dimensional array output

Title Link: https://www.nowcoder.com/study/live/716/5/17 Given a binary tree, return the sequence traversal result of the binary tree (traversing layer by layer from left to right) For example: The given binary tree is {3,9,20, #, #, 15,7}, The result of the binary tree sequence traversal is [ [3], [9,20], [15,7] ] Tips: 0 < = node numb ...

Added by MachineHead933 on Mon, 28 Feb 2022 10:02:39 +0200

keepMoving binary tree sequence traversal deformation and minimum dictionary ordered substring with length k

Let's start with sequence traversal. This is a common problem. Print it according to each layer, as follows: For Recommendation in Deep learning QQ Group 277356808 For deep learning QQ Second Group 629530787 I'm here waiting for you 1 - sequence traversal and deformation Sequence traversal is the most intuitive and simplest sequence, that ...

Added by kelvin on Mon, 21 Feb 2022 11:44:53 +0200

Binary search tree debut

Recently, I have made many problems about binary search tree, and found that many problems are solved by using the properties of binary search tree, and the routines are almost the same. Here is a summary. Properties of binary search tree If its left subtree is not empty, the value of all nodes on its left subtree is less than that of its roo ...

Added by modplod on Sat, 19 Feb 2022 19:55:41 +0200

Leetcode notes -- modification and construction of binary search tree in binary tree chapter

Catalogue of series articles I Array type problem solving method 1: dichotomy II Array type problem solving method 2: Double finger needle method III Array type problem solving method 3: sliding window IV Array type problem solving method 4: simulation V The basic operation and classic topics of the linked list Vi Classic title of hash tab ...

Added by kb9yjg on Sat, 19 Feb 2022 13:43:47 +0200

28 | heap and heap sorting: why is heap sorting not as fast as fast sorting?

How to understand "heap" Heap sorting is an in-situ sorting algorithm with time complexity of O(nlogn) There are two characteristics of the heap: A complete binary treeEach node in the heap must be greater than or equal to (or less than or equal to) the value of its left and right child nodes; The heap whose value of each node is g ...

Added by Cogen on Thu, 17 Feb 2022 12:41:55 +0200

Detailed binary tree classical basic algorithm

Binary tree is a common data structure in our daily learning. During the interview and study, we will inevitably encounter some algorithm problems related to binary tree. Today, I brought you some classic binary tree basic algorithm problems. Let's have a look! catalogue 1. Check whether the two trees are the same ① Title Description ② tr ...

Added by swissmant on Wed, 16 Feb 2022 19:50:30 +0200