What is recursion? Wikipedia gives the following definition: The programming skill of program calling itself is called recursion. Recursion is widely used in programming languages as an algorithm. The above statement is slightly official. In short, recursion is calling itself, but this call has certain conditions, such as: The subproblem must be the same as ..

#### Category : algorithm

Another contribution from my good friend EvilSay, the following is the original text: 1. Basic Definition Each child node of the binary search tree has at most two leaf nodes. Each node of the binary search tree has at most one root node. Stored elements must be comparable The value of each child node of ..

[Technology Salon 002] Data Center: Construction Practice of Yixin Agile Data Center | Yixin Technology Salon will be broadcast live online at 8: 00 pm on May 23. Click to sign up Project description: In this project, you will use reinforcement learning algorithm to realize an automatic maze robot. As shown above, the intelligent robot ..

subject In a two-dimensional array (each one-dimensional array has the same length), each row is sorted in ascending order from left to right, and each column is sorted in ascending order from top to bottom. Please complete a function and enter such a two-dimensional array and an integer to determine whether the array contains the ..

Title description Please implement a function to replace each space in a string with’ %20′. For example, when the string is We Are Happy, the replaced string is We%20Are%20Happy. The topic is not very precise: 1. Can multiple spaces be allowed to appear continuously? 2. If it is possible to have multiple spaces in succession, ..

subject Moving the first few elements of an array to the end of the array is called the rotation of the array. Enter a rotation of a non-subtractive array and output the smallest element of the rotated array. For example, array {3,4,5,1,2} is a rotation of {1,2,3,4,5}, and the minimum value of the array is ..

subject Title descriptionEveryone knows the Fibonacci sequence. Now you are required to enter an integer n. Please output the n-th term of the Fibonacci sequence (starting from 0, the 0-th term is 0). Basic idea This problem is actually treated as a counterexample of recursion in the sword-like offer. The essence of recursion is that ..

Topic 1 Integer Power of Numeric Value Given a double type floating point number base and an int type integer exponent. Find the exponent of base. Train of thought This problem is logically simple, but it is easy to make mistakes. The key is to consider all aspects and all situations. When exponent is positive, ..

1. Stack containing min function To define the data structure of the stack, please implement a min function (time complexity should be O(1)) in this type that can obtain the minimum elements contained in the stack. Train of thought 1. Define two stacks, one stack is used to store data and the other stack is ..

1. Copy of Complex Linked List Enter a complex linked list (each node has a node value and two pointers, one pointing to the next node and the other special pointer pointing to any node), and the returned result is the head of the copied complex linked list. (Note, please do not return the node ..

In the massive information flow, the strange technology guide has become an extremely important way for products to attract users and obtain profits by recommending the contents of interest to users through precise algorithms.This is a series of articles on algorithms, which will share 360 algorithm knowledge and experience accumulated by the algorithm team in ..

Project address:Link descriptionProject description:https://segmentfault.com/a/1190000005968734 About the usage and introduction of the project, you can see the above two links. The main content of this article is rightfilemap.jsThe paper analyzes the code step by step and introduces its operation principle and optimization strategy in detail. Preparation of knowledge points: NodeJSThe basic method of use (mainlyfsFile system); ..