C language sorting binary tree BST insertion, deletion and traversal

1, What is a sort binary tree? If the nodes of a binary tree are one child larger or empty than itself and the other is smaller or empty than itself, such a binary tree is called a sorted binary tree, that is, BST. Then there are two situations. One is that the left child is small and the right child is large, and the other is that the left ch ...

Posted by bgbs on Fri, 24 Dec 2021 16:55:06 +0100

[single chip microcomputer digital filtering algorithm]

Single chip microcomputer digital filtering algorithm Tip: you can add the directories of all articles in the series here. You need to add the directories manually For example, the first chapter is the use of pandas, an introduction to Python machine learning Tip: after writing the article, the directory can be generated automatically. For ...

Posted by kjtocool on Fri, 24 Dec 2021 13:13:21 +0100

C + + design pattern

Design pattern 1, Overview 1. Definition: a set of widely known, widely used, classified and catalogued reliable template code design experience summary. 2. Features: high cohesion and low coupling (also the ultimate goal) 3. Core idea: isolate changes and encapsulate changes 4. Significance: using design patterns can enhance the reusa ...

Posted by goclimb on Fri, 24 Dec 2021 05:50:10 +0100

Day4: stack of data structures

cataloguecatalogueSequence tableSingle linked list (without additional header node)Double linked list (with additional header node)Stack (sequential table implementation) preface Hello, last time we learned about double linked list, today we'll learn some properties and precautions of stack. 1. Definition of stack Stack is a linear table ...

Posted by DarrenL on Fri, 24 Dec 2021 05:44:57 +0100

PTA 7-35 inter city emergency rescue (25 points (s))

As the head of a city's emergency rescue team, you have a special national map. The map shows multiple scattered cities and some expressways connecting cities. The number of rescue teams in each city and the length of each expressway connecting the two cities are marked on the map. When other cities have emergency calls for you, your task is to ...

Posted by exa_bit on Fri, 24 Dec 2021 01:22:47 +0100

An article takes you to understand random numbers

As the basic language of Java, c + + and other languages, c language inevitably has many disadvantages, such as too complex operation of memory, trouble in calling random numbers and so on. Here we help you sort out the generation and calling of the following random numbers ·rand function and its associated srand function   &nbsp ...

Posted by itsureboy on Thu, 23 Dec 2021 21:22:30 +0100

My roommate learned to balance the binary tree after riding a small sheep

⭐ ♪ previous words ⭐ ️ hello everyone! This article will introduce the sword finger offerOJ question, which comes from Li Kou[ Sword finger Offer 55 - II balanced binary tree ]This paper will introduce the balanced binary tree based on the concept of binary tree and the depth of binary tree, and show that the code language is Java and C/C + ...

Posted by Ifa on Thu, 23 Dec 2021 18:20:24 +0100

Algorithm analysis and Design -- greedy algorithm "activity scheduling", "knapsack problem" and "Huffman coding"

1, Basic elements of greedy algorithm As the name suggests, greedy algorithms always make the best choice at present. In other words, the greedy algorithm does not consider the overall optimization, and its choice is only the local optimal solution in a sense. The problems that can be solved by greedy algorithm generally have the follow ...

Posted by jonnypixel on Thu, 23 Dec 2021 18:06:47 +0100

Generation method of simplest set of prime numbers satisfying Goldbach conjecture (C++)

The sparsest set of prime numbers that satisfy Goldbach's conjecture is generated. There is also a simplest set generator that satisfies the Goldbach Conjecture Effect, which does not require a prime number. The Goldbach conjecture effect refers to the generation of a final set of numbers from a set M that belongs to an equidistant set M (or a ...

Posted by EnDee321 on Thu, 23 Dec 2021 15:47:38 +0100

Strategy pattern of Java design pattern

Strategy mode Definition: define a series of algorithms, encapsulate them one by one, and make them replaceable. This pattern allows the algorithm to vary independently of the customers using it. Advantages: (1) policy pattern provides a way to manage related algorithm families. The hierarchical structure of policy class defines an algorithm ...

Posted by chocopi on Thu, 23 Dec 2021 14:56:30 +0100