Infrastructure - Simple Selection Sort and Heap Sort - Notes for Your Own Use

Select Sort principle Select Sort: Find the minimum value from the sequence to be sorted and the first value exchange of the sequence to be sorted each time. Diagram (The right side of the red line is the sequence to be sorted) C Language Code Be careful: At each exchange, the minimum subscripUTF-8...

Posted by wizzkid on Thu, 30 Sep 2021 02:08:41 +0530

Minimum spanning tree Prim algorithm C language - diagram

Algorithm Introduction Prim algorithm (PRIM algorithm), an algorithm in graph theory, can search the minimum spanning tree in the weighted connected graph. That is, the tree composed of edge subsets searched by this algorithm not only includes all vertices in the connected graph, but also the UTF-8...

Posted by zalath on Thu, 30 Sep 2021 04:34:02 +0530

Learning notes of data structure, algorithm and application - C + + language description - binary search tree

1, Binary search tree We learned the abstract data type dictionary earlier. The average time required for dictionary operations (find, insert and delete) using hash is O ( 1 ) O(1) O(1). The worst-case time of these operations is linear with the number of elements in the dictionary. Hash does UTF-8...

Posted by rptasiuk on Thu, 30 Sep 2021 07:44:18 +0530

Force Button Exercise 2 (Ten Questions)

Catalog 1.Remove duplicates from an ordered array 2.Removing Elements 3.Search Insert Location 4. Implement strStr() 5.(6)Z glyph transformation 6. (19) Delete the last N th node of the list of chains 7. (23) Merge K ascending list 8. (25) K sets of flip chains 9. (58) Length of the last word 1UTF-8...

Posted by simonb on Thu, 30 Sep 2021 21:33:46 +0530

Sorting algorithm - heap

1. Concept of reactor A heap is usually a binary tree that can be viewed as a complete binary tree. (1) Large root heap means that the root node of each subtree in the complete binary tree is larger than its left and right children (if any). (2) Small root heap means that the root node of each UTF-8...

Posted by sanchez77 on Thu, 30 Sep 2021 23:43:31 +0530

The next node of JZ57 binary tree

The next node of JZ57 binary tree describe Given a node in a binary tree, please find the next node in the middle order traversal order and return. Note that the nodes in the tree contain not only the left and right child nodes, but also the next pointer to the parent node. Enter Description: TUTF-8...

Posted by KevMull on Fri, 01 Oct 2021 00:01:13 +0530

Code set and algorithm of [postgraduate entrance examination] tree

It mainly summarizes a series of structures and algorithms of forest, binary tree and binary sorting tree. The code comes from Wang daoshu so as not to forget in the future. Ha ha Forest. Node structure Parental representation #define MaxSize 100 typedef struct TNode{ //Parent node data type ElUTF-8...

Posted by evanluke on Fri, 01 Oct 2021 00:15:20 +0530

Data structure and algorithm: 2. Queue

introduce Alignment: first in, first out, and queuing in life are the same truth 1) Queue is a sequential list, which can be implemented by array or linked list. 2) Follow the principle of first in, first out. That is, the data stored in the queue should be taken out first. After the deposit, UTF-8...

Posted by 0p3n_p0rT on Fri, 01 Oct 2021 01:15:36 +0530

Let's learn data structure -- two-way circular linked list

Let's learn data structure -- two-way circular linked list The two-way leading circular linked list is an important linked list in the linked list. Because of its most complex structure, it also makes it easier in some aspects. It is in sharp contrast to the simple single linked list but complUTF-8...

Posted by jerry_louise on Fri, 01 Oct 2021 07:13:38 +0530

[binary tree] non recursive preorder, inorder and postorder traversal of binary tree

1. Preorder traversal The preorder traversal is about the middle node. Each time, the intermediate node is processed first. First, put the root node into the stack, then add the right child to the stack, and then add the left child. Why join the right child first and then the left child? BecausUTF-8...

Posted by gasoga on Fri, 01 Oct 2021 07:49:10 +0530