DSA_ Recursion (java data structure and algorithm)
Recursive application scenario
Look at a practical application scenario, maze problem (backtracking), recursion
The concept of recursion
In short: recursion is that the method calls itself and passes in different variables each time. Recursion helps programmers solve complex problems and make the code concise.
Recursive call mechanism ...
Added by greenba on Tue, 05 Oct 2021 06:11:37 +0300
Algorithmic Notes Reading Record DAY_18
CHAPTER_6 C++STL correlation
6.3 string
In the c language, we use char arrays to store strings, which can be cumbersome. Therefore, adding a string type to STL makes it easier for us to manipulate strings. To use a string, you need to add a header file #include <string>.
string's usage is recorded in Algorithmic Notes P202-P209. Mo ...
Added by Quevas on Sun, 03 Oct 2021 23:10:09 +0300
The sum of two and three numbers of Leetcode
1.Sum of Two Numbers
Solving the sum of two numbers is the first question on LeetCode. One notable part of the title is that the same element in the array cannot be repeated in the answer. This paper tries to solve with the most direct method, and then optimize the solution process step by step. Knowledge points: Use of map, unordered_map ...
Added by shiflett on Sun, 03 Oct 2021 19:01:41 +0300
JAVA: summary of traversal methods of binary tree: recursive and iterative implementation of depth first traversal, breadth first traversal + pre, middle and post order traversal
1. Main traversal methods of binary tree
(1) Depth first traversal: traversal goes to the depth of the tree and returns when a leaf node is encountered. It can be implemented by recursion or iteration. Recursion is generally used to simulate the process of traversing deep.
It can be further divided into pre order ...
Added by ma5ect on Sat, 02 Oct 2021 23:48:30 +0300
A hash table that can be understood at a glance
In the previous article on linked lists, I wrote the LRU cache elimination algorithm based on linked lists,
This is a link https://mp.csdn.net/mp_blog/creation/editor/120435048
Let's take a look at how the hash table and linked list in LinkedHashMap combine to implement the LRU cache elimination algorithm.
LRU cache elimination algorithm
Le ...
Added by Fatboy on Sat, 02 Oct 2021 20:54:12 +0300
Principle and C + + implementation of KMP algorithm
preface
Recently, Feynman learning method has been practiced and applied to learning. KMP algorithm is a difficult knowledge point in data structure and algorithm. It took several days to understand the principle of this algorithm and implement it in C + +. Write this blog to sort out the principle of KMP algorithm and my C + + implementation ...
Added by phpbeginner0120 on Sat, 02 Oct 2021 05:28:19 +0300
Binary sort tree
In this article, the definition of binary sort tree:
If the left subtree is not empty, the values of all nodes on the left subtree are less than or equal to the values of its root nodeIf the right subtree is not empty, the value of all nodes on the right subtree is greater than that of its root nodeThe left and right subtrees are also binary s ...
Added by dfarrell on Sat, 02 Oct 2021 01:05:43 +0300
An operation constrained linear table ---------- queue
queue A linear table with limited operation. It can only be inserted at one end of the table and deleted at the other end of the table. Feature: first in, first out Team leader: the end that can be deleted, also known as the team leader. End of line: the end that allows insertion
1. Sequential storage structure: Focus on circular queue: in ord ...
Added by willl on Fri, 01 Oct 2021 22:26:55 +0300
Learning notes: 2.3 chain representation and implementation of linear list (detailed explanation of single chain list)
2.3 chain representation and implementation of linear table
(Note: all codes have been successfully tested. Compilation environment: devC + +)
(1) Review: (advantages and disadvantages of linear sequential storage structure)
advantage:
There is no need to add additional storage space to represent the logical relationship between elements i ...
Added by anand on Mon, 27 Sep 2021 14:16:21 +0300
[learning notes] what do you know about queues, monotonous queues and cyclic queues? (implemented in C language)
queue
Basic concepts
Queue is a first in first out (FIFO) data structure.For a queue, the end of the table is called the tail, and the end of the header is called the front.All elements can only enter from the end of the queue. The operation of entering the queue is called joining the queue.At the same time, all elements can only be ejected ...
Added by Pethlehemm on Mon, 27 Sep 2021 06:04:49 +0300