9, Notes on data structure of postgraduate entrance examination -- traversal of binary tree and construction of clue binary tree, common error prone points
1, Traversal of binary tree
Access each node in the tree according to a search path, so that each node is accessed. It is mainly divided into first order traversal, middle order traversal, second order traversal and sequence traversal
2, Preorder traversal
2.1 manual calculation
The exam usually gives the shape of a tree and writes its preo ...
Posted by MHz on Sun, 05 Dec 2021 08:04:55 -0800
[two pointers] Chapter 7 of programming competition series - six force buckle classic takes you to brush and explode double pointers
Welcome back to: meet blue bridge, meet you, not negative code, not negative Qing!
catalogue
1, What are two pointers
2, Chestnut introduction
3, Force buckle classic
Chestnut 1: reverse string
Chestnut II: lifeboat
Chestnut 3: the middle node of the linked list
Chestnut IV: circular linked list
Chestnut five: circular li ...
Posted by gitosh on Sun, 05 Dec 2021 07:09:43 -0800
Chapter 87 LeetCode refers to the maximum sum of continuous subarrays of Offer dynamic programming
1. Title Description
Enter an integer array. One or more consecutive integers in the array form a sub array. Find the maximum value of the sum of all subarrays.
The required time complexity is O(n).
Example 1:
Input: num = [- 2,1, - 3,4, - 1,2,1, - 5,4] Output: 6 Explanation: the maximum sum of continuous subarray [4, - 1,2,1] is 6. ...
Posted by Shaudh on Sun, 05 Dec 2021 04:53:43 -0800
Golang sort package sorting (full set of details)
1, Integer
First of all, use the simplest example provided inside to sort the shaping
package main
import (
"fmt"
"sort"
)
func main() {
a := sort.IntSlice{2, 8, 3, 7, 9, 4, 1, 6}
fmt.Println("Before sorting", a)
sort.Sort(a)
fmt.Println("After sorting", a)
}
You'd better wonder what sort.IntSlice is. Click to view the source ...
Posted by Johan Beijar on Sun, 05 Dec 2021 03:28:54 -0800
Idea of time slice rotation algorithm (java)
1, Request
This paper expounds the process from submission to execution of multiple jobs, and explains the concept, differences and relationship of three-level scheduling;The ideas, characteristics, advantages and disadvantages of FCFS, SJF/SPF, HRRN, RR and multi-level feedback queue scheduling algorithms are described;The algorithm realize ...
Posted by jackson4me90 on Sun, 05 Dec 2021 01:56:20 -0800
13_JavaScript data structure and algorithm binary search tree
JavaScript data structure and algorithm (XIII) binary search tree
Binary search tree
Binary Search Tree (BST), also known as binary sort tree and Binary Search Tree.
Binary search tree is a binary tree and can be empty.
If it is not empty, the following properties are met:
Condition 1: all key values of non empty left subtree are less than ...
Posted by bam2550 on Sun, 05 Dec 2021 00:54:35 -0800
Solution to the problem of Niuke Xiaoyue race 41 (A~F)
Today is lzgg a question, a special session for Xiao Hong; The topic is not very difficult, but the website always collapses during the competition, so the experience is not very comfortable;
A. Xiao Hong's sign in question
Title: Portal
Question meaning: a question, a total of b people participated, and the total number of questions passed ...
Posted by ineedhelp on Sun, 05 Dec 2021 00:29:12 -0800
Leetcode game 270 weekly question solution
Problem A - Find the 3-bit even number
meaning of the title Any three numbers in the array are spliced into three digits. Non even numbers and no leading 0 are required. All qualified numbers are returned in ascending order thinking See that the range of the given array is 100, and directly triple loop. Since the requirement is not repeated, i ...
Posted by derekbelcher on Sat, 04 Dec 2021 22:51:46 -0800
Fast number theory transformation (NTT)
Fast number theory transformation (NTT)
I wanted to learn this thing before. I haven't done it orz. Now I'll make it up.
I don't think I have much new knowledge about learning this thing. It's good to master FFT before learning.
FFT can be seen here: https://www.cnblogs.com/Tenshi/p/15434004.html
NTT is used to solve the modular problem of po ...
Posted by dnast on Sat, 04 Dec 2021 19:49:24 -0800
Introduction to ACM [read in and output optimization]
This article is mainly a summary based on oiwiki, and will do a series of related articles in the future. If you want to continue reading, you can follow the column. The purpose of this column is to lay a foundation for my recent systematic. So I want to write a column for beginners who like ACM.
Why read in and output optimization
In f ...
Posted by ugriffin on Sat, 04 Dec 2021 18:18:09 -0800