Learning notes: Chapter 10 internal sorting
Chapter X internal sorting
Linear table operation
Union of unordered linear tables:
For example: A = (17, 55, 9, 30, 28)
B = (30,68,5,17)
Time complexity O(LA*LB)
Union of ordered linear tables:
For example: A = (7, 15, 29, 38)
B = (3,7,46,57)
Time complexity O(LA+LB)
lookup
Sequential lookup of unordered tables: O(n)
...
Posted by RazorICE on Tue, 21 Dec 2021 13:23:42 +0100
Data structure and algorithm -- sparse array
Data structure and algorithm -- sparse array
(the learning content is the JAVA data structure and algorithm of Mr. Han Shunping of shangsilicon Valley) 1. What is a sparse array: When most elements in an array are 0 or an array with the same value, you can use a sparse array to save the array. 2. Processing method of sparse array:
How many ro ...
Posted by generic88 on Tue, 21 Dec 2021 09:18:17 +0100
Two single linked lists generate an additive linked list
[title] assuming that the value of each node is between 0 and 9, the whole linked list can represent an integer. For example, 9 - > 3 - > 7 can represent an integer 937. Given the header nodes head1 and head2 of the two linked lists, please generate a result representing the added value of the two integers
[example] [note] first find th ...
Posted by vishal99 on Tue, 21 Dec 2021 00:55:38 +0100
Java Set and data structure Map and Set
Search tree
Binary search tree, also known as binary sort tree, is either an empty tree * * or a binary tree with the following properties:
If its left subtree is not empty, the values of all nodes on the left subtree are less than those of the root nodeIf its right subtree is not empty, the values of all nodes on the right subtree ar ...
Posted by JoeBuntu on Mon, 20 Dec 2021 20:49:32 +0100
He is enough for the six sorting of data structure (easy to understand, suitable for first-time learning)
Navigation:
1. Insert sorting directly
2. Hill sort
3. Select Sorting
4. Bubble sorting
5. Heap sorting
6. Quick sort
1. Insert sorting directly
Idea: it can be understood as inserting the sequence to be arranged into the ordered sequence in turn; Compare from back to front, compare the number to be inserted with the last element of th ...
Posted by hame22 on Mon, 20 Dec 2021 16:00:15 +0100
Array and string 10 - implement strStr()
Using KMP algorithm to implement str ()
One topic From leetcode official website
Here are two strings, haystack and need. Please find the first position where the need string appears in the haystack string (the subscript starts from 0). If it does not exist, it returns - 1. Note: when the need is an empty string, we should return 0. This is c ...
Posted by angelac on Mon, 20 Dec 2021 12:08:54 +0100
Basic data structure: P2 5 - application example -- > polynomial multiplication and addition - C implementation
This series of articles is the study notes of data structure of Chen Yue and he Qinming of Zhejiang University. The links of the previous series of articles are as follows: Fundamentals of data structure: P1 - Basic Concepts Basic data structure: P2 1 - linear structure - > linear table Basic data structure: P2 2-linear structure - > stac ...
Posted by halex on Mon, 20 Dec 2021 11:55:35 +0100
Learning to find two points in three problems -- solving problems in java, python and c ( ̄▽  ̄)~*
Binary search
Binary search is usually applied to an ordered array. It is an algorithm that divides the search space into two after each comparison.
Terms used in binary search:
Target: target. The value you want to find Index: index. The current location you want to find Left, Right: left and Right indicators (which can be understood as ...
Posted by kelvin on Mon, 20 Dec 2021 11:18:43 +0100
9. Users establish their own data model
Defining and using structure variables
C language allows users to establish a combined data structure composed of different types of data, which is called structure Struct is the keyword that declares the structure type Declare the general form of a struct type: Struct structure name { Member table column } Declare each member: type name membe ...
Posted by gmcalp on Mon, 20 Dec 2021 03:47:37 +0100
111 minimum depth of binary tree
subject
Given a binary tree, find its minimum depth.
The minimum depth is the number of nodes on the shortest path from the root node to the nearest leaf node.
Note: leaf nodes refer to nodes without child nodes.
Example 1: Input: root = [3,9,20,null,null,15,7] Output: 2
Example 2: Input: root = [2,null,3,null,4,null,5,null,6] Output: 5
M ...
Posted by Bomas on Sun, 19 Dec 2021 19:47:43 +0100