Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the idea of the algorithm to solve the problem?

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Most people do not understand the knowledge points of this article "what is the idea of solving the algorithm?", so the editor summarizes the following contents for you. The content is detailed, the steps are clear, and it has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "algorithm problem-solving ideas" article.

Analytical framework

1. The algorithm efficiency is analyzed by using the algorithm input size n as a parameter.

2. Time complexity: find out the basic operation O (1), and then calculate its number of runs (ignore the multiplication constant and focus only on the number of growth).

3. Times of growth: log2n

4. The worst, average and best efficiency all refer to the efficiency when the input scale is n (the average efficiency can be deduced to the result by reference).

The main analysis framework is summarized as follows:

The main results are as follows: 1. the time efficiency and space efficiency of the algorithm are measured by the function of input scale.

2. The time efficiency is measured by the number of execution times of the basic operation of the algorithm, and the space unit is measured by the number of additional units consumed by the algorithm.

3. When the input scale is the same, the efficiency of writing algorithms will be significantly different. For this kind of algorithms, the worst, average and best efficiency need to be analyzed.

4. The framework is mainly concerned about its efficiency when the input scale tends to be infinite.

Asymptotic symbols and basic efficiency types

1. O (g (n)) is the number of growth.

2. Ω (g (n)) is the set of functions with the increasing degree > = cedulg (n), and the lower order

3. θ (g (n)) is the set of functions with the increasing degree = cedulg (n), with the same order.

The overall efficiency of the algorithm is determined by the part with larger growth times.

A General Scheme for Mathematical Analysis of non-recursive problems

1. A metric that determines which parameter represents the input size

2. Find out the basic operation of the algorithm

3. Check whether the number of times the basic operation is performed depends only on the input size, and if it also depends on some other features (such as the position of elements in the array, etc.), the analysis is the worst, average, and best efficiency.

4. Establish a summation expression for the number of times the basic operation of the algorithm is performed (it may be a recursive expression)

5. Use the standard operation or rule of summation operation to establish a closed formula of the number of operations, or at least determine the number of its growth.

A General Scheme for Mathematical Analysis of Recursive problems

1. A metric that determines which parameter represents the input size

2. Find out the basic operation of the algorithm

3. Check whether the number of times the basic operation is performed depends only on the input size, and if it also depends on some other features (such as the position of elements in the array, etc.), the analysis is the worst, average, and best efficiency.

4. For the execution times of the basic operation of the algorithm, a recursive relation and the corresponding initial conditions are established.

5. Solve this recursion, or at least determine the number of times it grows.

The above is about the content of this article on "what is the idea of solving the algorithm?" I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

  • How to realize the sliding scoring effect of uniapp

    This article mainly introduces uniapp how to achieve sliding scoring effect, the article introduces in great detail, has a certain reference value, interested friends must read it! Uniapp development, slide score, click score

    © 2024 shulou.com SLNews company. All rights reserved.

    12
    Report