Dichotomy summary (super detailed) with illustration
1. Dichotomy
Binary search is an algorithm with high time efficiency. Especially in the face of a large amount of data, its search efficiency is very high and the time complexity is log(n). The main idea is to keep folding in half. Half of the data can be removed each time. Finally, all unqualified results are removed, leaving only one ...
Posted by mikebyrne on Tue, 01 Feb 2022 12:34:07 +0100
Kiner algorithm brush inscription: fast platoon and fast platoon idea (hand tearing algorithm)
Guide to series of articles
Guide to series of articles
preface
After we are familiar with the idea and implementation principle of quick sort, we can bring a lot of inspiration and inspiration in our actual development. With the idea of double pointer walking of quick sort, we can also solve many kinds of quick sort problems. Now let's use ...
Posted by wvwisokee on Tue, 01 Feb 2022 08:41:52 +0100
Data structure and algorithm (Java implementation) [hash table]
1. Introduction
2. Hash table
(- 1) related terms
1. Hash method (hash method) Select a function, calculate the storage location of elements by keyword according to the function, and store them according to this. When searching, the same function calculates the address of the given value k, and compares k with the key value of the element ...
Posted by mart on Tue, 01 Feb 2022 08:37:30 +0100
Data structure & algorithm - inverse Polish four arithmetic
algorithm
1, Algorithm for converting infix expression to suffix expression: 1. Scan a infix expression from left to right. 2. If the operand is read, judge the type of the operand and store the operand in the operand stack 3. If operator is read (1) If the operator is an open parenthesis "(", it is directly stored in the operator st ...
Posted by ScotDiddle on Tue, 01 Feb 2022 07:48:54 +0100
java collection class - list
1. ArrayList
public class ArrayList<E> extends AbstractList<E>
implements List<E>, RandomAccess, Cloneable, java.io.Serializable{
}
RandomAccess # is a flag interface, which indicates that the List collection implementing this interface supports fast random access. In ArrayList, we can quickly obtain the element object t ...
Posted by eheia on Tue, 01 Feb 2022 07:33:25 +0100
Three traversals of LeetCode 144 145 94 binary tree -- iterative method
Reference article 1 Reference article 2
Idea:
Previously, we learned to use recursive method to traverse three kinds of binary trees. This time, we consider using iterative method to traverse and stack. It is recommended to read both reference articles. Among the two reference articles, the first one talks about how to use the iterative metho ...
Posted by amrigo on Tue, 01 Feb 2022 05:47:06 +0100
Comparison of priority queue (heap) and java objects
1, Sequential storage of binary tree
Storage mode Use the array to save the binary tree structure, that is, put the binary tree into the array by sequence traversal. Generally, it is only suitable for representing complete binary trees, because incomplete binary trees will waste space. The main use of this method is the representation of the ...
Posted by ChibiGuy on Tue, 01 Feb 2022 03:08:31 +0100
Basic principle and interface implementation of linked list
Linked list summary review
1. Basic concept of linked list
1.1 difference between linked list and array
Linked list and array are linear storage structures, which are not fundamentally different in logic, because the data stored in logic is continuous, but the data stored in array is continuous in logic and physics, and the linked list is no ...
Posted by rachae1 on Tue, 01 Feb 2022 00:35:49 +0100
Practical series - thread safe collection class in Java
Introduction in java development, we often encounter the problem of thread safety of set classes. In the development process of Java language, from the initial thread unsafe set classes to the thread safe set classes that basically support many thread safe set classes, we don't need to pay attention to thread safety in some scenes ...
Posted by tmayder on Mon, 31 Jan 2022 23:31:42 +0100
Binary balanced tree (AVL) of data structure and algorithm
I'm a sophomore. The purpose of writing this article is to make a certain record of my knowledge and technology, and I'm willing to share it with you. Because I'm still young, there are inevitably some mistakes and omissions in the published article. Please forgive me and correct me if you read this article. If you have any questions during rea ...
Posted by Nymphetamine on Mon, 31 Jan 2022 20:09:58 +0100