[tree] establish a binary tree stored in a binary linked list + traverse the binary tree (first order, middle order, second order, sequence)

Establish binary tree stored in binary linked list + traverse binary tree (first order, middle order, second order and sequence) 1. Establish a binary tree stored in a binary linked list 1-1. principle The construction of binary tree uses the principle of recursion. When building a binary tree according to the pre order sequence, in order to ...

Added by Poomerio on Mon, 10 Jan 2022 06:33:27 +0200

Java Basics (2D array)

3, Two dimensional array 1. Overview of 2D arrays Our big data class of digital plus technology has many students in each class, so it can be stored in an array, and we have many big data classes at the same time. This should also be stored in an array. How to represent such data? Java provides a two-dimensional array for us to use. This show ...

Added by lkalik on Mon, 10 Jan 2022 02:51:14 +0200

[Java design pattern] how to use inheritance correctly? Use of Richter's substitution principle

👏 About the author: Hello, I'm cabbage ~ ~, a sophomore in school, and a new star creator in the Java field.📝 Personal homepage: Cabbage CSDN blog📕 Series column: This article is written in the Java design pattern column: Isn't that the Java design pattern📧 If there are mistakes in the knowledge points of the article, please correct them! L ...

Added by lispwriter on Sun, 09 Jan 2022 21:24:07 +0200

Arrays emulate stacks and queues

1, First of all, we should understand the concept of stack. In c + +, STL exists, which can facilitate us to do many things, and stack is a part of it. In short, stack is a kind of first in and last out data organization By thinking and simulating the structure of stack, we find that we can use one-dimensional array and a variable tt to re ...

Added by jgh84 on Sun, 09 Jan 2022 12:02:34 +0200

Gobang AI algorithm man-machine battle (spring object color feather version)

Gobang AI algorithm preface: Coordinates Xi'an, written during the closure of the city. Improved the previously written AI Gobang game based on Minimax strategy, which is implemented in java, using java's old jframe form and drawing class. After writing, it was sorted into this blog. The game adopts the second-dimensional style of chunwu, wit ...

Added by scofansnags on Sun, 09 Jan 2022 07:49:56 +0200

python advanced algorithm and data structure: fast query and merging of collections

In code design, we often face such scenarios. Given two elements, we need to quickly judge whether they belong to the same set, and different sets can be quickly combined into one set when necessary. For example, if we want to develop a social application, we need to judge whether the two users are friends, Or whether they belong to the same gr ...

Added by califdon on Sun, 09 Jan 2022 06:34:04 +0200

Codeforces round #758 (Div.1 + div.2) C ~ d problem solution

1608C - Game Master Title Description: Now there are n n n players are competing, of which No i i The ability values of i players in the two maps are ...

Added by b1011 on Sun, 09 Jan 2022 04:58:57 +0200

java implementation and understanding of seven sorting

Insert sort 1. Insert sorting directly Moving picture transfer gate. Thought: when playing poker, uncover the cards one by one and find the insertion position from back to front, so that the cards in your hand are always in an orderly state // 1. Direct insertion public static void insertSort(int[] array) { // 1. Uncover the cards on ...

Added by kasitzboym on Sun, 09 Jan 2022 04:13:50 +0200

[Blue Bridge Cup] [Stege cup · cloud blue bridge - algorithm training camp] week 1 homework

1. Running training Problem Description: Xiao Ming wants to do a running training. At the beginning, Xiao Ming is full of physical strength, and the physical strength value is 10000. If Xiao Ming runs, he will lose 600 physical strength per minute. If Xiao Ming has a rest, he will increase his physical strength by 300 per minute. The los ...

Added by raydenl on Sun, 09 Jan 2022 03:00:03 +0200

Machine learning algorithm 08 clustering exploration (04 exploration of K-means clustering algorithm, hierarchical clustering concept, density clustering DBSCAN exploration)

Exploration of K-means clustering algorithm import numpy as np import matplotlib.pyplot as plt import sklearn.datasets as ds import matplotlib.colors from sklearn.cluster import KMeans,MiniBatchKMeans def expand(a,b): d=(b-a)*0.1 return a-d,b+d if __name__ == '__main__': N=400 #Create 400 samples centers=4 ...

Added by Dark Phoenix on Sat, 08 Jan 2022 21:21:04 +0200