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

Data structure - hash table

1, HashSet, HashMap, HashTable First, set represents the unordered elements of the set. Duplicate elements are not allowed in the set Map represents a set composed of multiple key values. Map set is an extension of set set Based on hashing principle, HashMap stores and obtains objects through put() and get() methods. Create a HashMap M ...

Posted by nblackwood on Fri, 24 Dec 2021 08:27:06 +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

Dark horse programmer C + + learning record: class and object part3-4 object model and this pointer & friend

4.3 C + + object model and this pointer 1. Member variables and member functions are stored separately In C + +, member functions and member objects are stored separately 1. Only non static member variables belong to the object of the class, and non static member variables occupy the object space; 2. Static member variables do not occupy the ...

Posted by shiranwas on Thu, 23 Dec 2021 19:06:59 +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

CF484-E. Sign on Fence

Portal Given length is N N Array of N Several triples { l , r , w } ...

Posted by SergiuGothic on Thu, 23 Dec 2021 11:40:55 +0100

Course design student information management system python (character, list, dictionary, modular complete operation)

Primary comprehensive application of python -- student information management system Variable process control function module Project requirements: Realize the addition, deletion, modification, query and exit of the business card. Select different functions by selecting different numbers. The user's name, telephone, QQ email can be modified ...

Posted by vMan on Thu, 23 Dec 2021 09:35:43 +0100

Four methods of linked list inversion (stack, head insertion, three finger needle and recursion)

Four methods of single linked list inversion or transpose The reversal of the linked list is essentially to reverse the contents of the linked list: If the data stored in the linked list is: 1 - > 2 - > 3 - > 4 - > 5; After the reversal, it is: 5 - > 4 - > 3 - > 2 - > 1; Here are four methods to reverse the linked list ...

Posted by kol090 on Thu, 23 Dec 2021 04:35:35 +0100

Search: C language code implementation of linear table (sequential search and half search)

catalogue 1, Definition of two classes of linear table structure 2, Initialization of linear table and establishment of linear table according to input elements 1. Initialization of linear table. Initialize an empty linear table 2. Add elements to the linear table according to user requirements 3, Search the search 1 function in sequence ...

Posted by Biocide on Thu, 23 Dec 2021 00:47:37 +0100