Data structures and algorithms

#Data structure and algorithm Introduction There is no best algorithm in the world, only the most suitable algorithm Logical structure Physical structure Talk about algorithm Algorithm time complexity Just tell you to pay attention to the highest order, then ignore the constant product of con ...

Posted by izzy on Wed, 29 Sep 2021 14:07:18 -0700

Prefix Tree (Trie Tree)

Trie Tree A Trie tree, also known as a dictionary tree, or word search tree or key tree, is a tree structure and a variant of a hash tree. Typical applications are for counting and sorting large numbers of strings (but not just strings)It has the advantage of minimizing unnecessary string comparisons and being more efficient than hash tables. ...

Posted by savagenoob on Wed, 29 Sep 2021 10:00:10 -0700

Data structure Part5

Chapter VI diagram 1. Basic structure of the drawing 1.1 basic concept of drawing 1) Graph G (graph) is composed of Vertex set V (Vertex) and Edge set E (Edge), which is marked as G=(V,E), where V(G) represents the finite nonempty set of vertices in graph G; E(G) represents the set of relationships (edges) between vertices in graph G. If V={ ...

Posted by freelance84 on Tue, 28 Sep 2021 21:04:04 -0700

Dynamic programming knapsack problem

Knapsack problem: there are N items and a knapsack with a capacity of W. each item has its own volume W and value v. find out which items can maximize the total value of the items contained in the knapsack. If only 0 or 1 items can be selected for each item, the problem is called 0-1 knapsack problem; If the quantity of each item is not limited ...

Posted by RyanDev on Mon, 27 Sep 2021 21:52:06 -0700

What we must know about binary trees

Trees have some simple basics that you must know Tree is a nonlinear data structure, which is defined recursivelyNode degree: the number of subtrees contained in a tree is called node degree As shown in the figure, the degree of node A is 6, and the degree of node B is 0Tree degree: the degree of the largest node of a tree is called the degree ...

Posted by LiamProductions on Mon, 27 Sep 2021 06:35:15 -0700

Data structure and algorithm stack and queue

Stacks and queues are linear tables that restrict the insertion and deletion of total equity changes at the end of the table Stack -- last in first out         Stack algorithms must be used: number system matching, expression evaluation, bracket matching detection, eight queens problem, line editing program, function ca ...

Posted by jazz_snob on Mon, 27 Sep 2021 06:29:13 -0700

LeetCode 416. Segmentation and subsets

So far, I have written more than 600 algorithm problems, some of which have been sorted into pdf documents. At present, there are more than 1000 pages (and will continue to increase), which can be downloaded for free Download link: https://pan.baidu.com/s/1hjwK0ZeRxYGB8lIkbKuQgQ Extraction code: 6666 We talked about it earlier 520, backtrac ...

Posted by Desertwar on Sun, 26 Sep 2021 18:18:18 -0700

Data structure - detailed explanation of leading circular two-way linked list

Tip: after the article is written, the directory can be generated automatically. Please refer to the help document on the right for how to generate it preface In the last data structure column, we introduced the interface functions of the single linked list. You may find that the single linked list has some defects: for example, one nod ...

Posted by jhenary on Sun, 26 Sep 2021 18:02:18 -0700

stack and queue

stack What is the stack A stack is a table that restricts the insertion (push) and deletion (pop) of elements to only one position. This position is the end of the table, which is called the top of the stack. When you first understand the stack, you can understand it as a special array. Elements are added and deleted at the top of the s ...

Posted by eth0g on Sun, 26 Sep 2021 12:12:00 -0700

Java data structure -- linked list and stack

Introduction to linked list Is an ordered list, but memory is stored differently as follows: It is stored as a node Each node contains a data field to store data, and the next field points to the next node Each node is not necessarily stored continuously The linked list is divided into the linked list of the leading node and the linked l ...

Posted by calmchess on Sun, 26 Sep 2021 01:13:20 -0700