Is the time complexity of the algorithm only related to the size of the problem?

Updated on technology 2024-02-16
12 answers
  1. Anonymous users2024-02-06

    The answer to the time complexity of the algorithm in most question banks is to choose the option related to the size of the problem, and the distractors are often the performance of the computer hardware, the quality of the compiled program, the programming language, and so on. (Direct).

    Other editions of the book also mention the initial state of the data to be processed, such as whether it is already ordered. (Supplemental).

    The temporal complexity of an algorithm, i.e., its efficiency, is usually only related to the nature of the algorithm itself, which in turn includes the size of the problem involved and the choice of algorithm strategy. (Personal experience).

    The time complexity of the algorithm, i.e., the number of times the basic operation is repeated, is a function f(n) of the problem scale n, and the time measure of the algorithm is denoted as t(n) = o(f(n)); It means that as the problem size n increases, the growth rate of the algorithm execution time is the same as the growth rate of f(n), which is called asymptotic time complexity, also known as time complexity. (The relevant explanation in the book of Teacher Yan Weimin).

  2. Anonymous users2024-02-05

    Hello, I see that no one has come to your question for a long time, but no one will be deducted if the question expires and your bounty points will be forfeited! So I'll give you a few suggestions:

    First, you can choose to ask questions in the right category, so that more people will know the answers to your questions, and more people will be able to do so.

    Fourth, there are many professional forums and knowledge platforms on the Internet, and there are also a lot of information on them, and I always go to the forum to seek solutions to professional problems.

    Fifth, ask your questions more carefully and clearly! It's easier for people to understand what it means!

    Thanks for my suggestion! !

  3. Anonymous users2024-02-04

    The number of loop executions is log(3,n), so the time complexity is o(log(n)) The number of loop executions is n-1, so the time complexity is o(n) The number of loop executions is n, so the time complexity is o(n) The number of loop executions is irrelevant to n, so the time complexity is o(1).

  4. Anonymous users2024-02-03

    It was not long after I was optimistic that I would not go home.

  5. Anonymous users2024-02-02

    I think it mostly depends on the size of the problem and the quality of the algorithm!

    Generally, the number of loops is calculated to feel the time complexity!

  6. Anonymous users2024-02-01

    Select the original operation that is the basic operation for the problem (or algorithm type) under study, and take the number of repetitions of the basic operation as a measure of the time complexity of the algorithm.

  7. Anonymous users2024-01-31

    The amount of output data, the quality of the algorithm, and the amount of input data.

  8. Anonymous users2024-01-30

    The scale of the problem is generally related to n.

  9. Anonymous users2024-01-29

    The selection is based on the research.

    Question (or count.)

    type) said. Basic operations.

    The number of repeated executions of the original operation and basic operation is calculated.

    Complexity metrics.

  10. Anonymous users2024-01-28

    The time complexity of the algorithm depends on the size of the problem, the initial state of the data to be processed.

    The frequency of a statement refers to the number of times the statement is repeated in the algorithm. The sum of the frequencies of all statements in the algorithm is denoted as t(n), which is a function of the problem scale n of the algorithm, and the time complexity is mainly analyzed by the order of magnitude t(n). The frequency of basic operations (statements in the deepest loop) in the algorithm is of the same order of magnitude as tn), so the frequency of the basic operations in the algorithm (fn) is usually used to analyze the time complexity of the algorithm3.

    The time complexity of the algorithm is denoted as: t(n) = o(fn)), where the meaning is the order of magnitude t(n), and its strict mathematical definition is: if t(n) and fn) are two functions defined on a set of positive integers, then there are normal numbers c and n, such that when n no, both satisfy 0 t(n) cfn).

    The time complexity of the algorithm depends not only on the size of the problem, but also on the nature of the data to be fed (e.g., the initial state of the input data element).

  11. Anonymous users2024-01-27

    [Smile] Hello dear, I'm checking for you here, it will take some time to type, please wait a while, I'll get back to you right away

    Smile] [smile] I hope I can help you, if there are no other problems, satisfied with my service, please give a thumbs up, I wish you all the best, all your wishes come true!

  12. Anonymous users2024-01-26

    It is a measure of the time it takes to execute an algorithm. It is generally a function of the size of the problem.

    In computer science, the time complexity of an algorithm is a function that quantitatively describes the running time of the algorithm. This is a function about the length of the string that represents the input value of the algorithm. The time complexity is often expressed by the big o symbol, excluding the low-order term and the first coefficients of this function.

    In this way, the time complexity can be referred to as asymptotic, which examines the situation when the size of the input values approaches infinity.

    Algorithm complexity is divided into temporal complexity and spatial complexity. What it does: Time complexity refers to the amount of computational effort required to execute an algorithm; Space complexity, on the other hand, refers to the memory space required to execute the algorithm.

    The complexity of the algorithm is reflected in the amount of resources required by the computer when running the algorithm, and the most important computer resources are time and space resources, so the complexity is divided into time and space complexity.

    Mathematically defined function: given a non-empty set of numbers a, apply the corresponding rule f to a, denoted as f(a), and get another set of numbers b, i.e., b=f(a). Then this relation is called a function relation, referred to as a function.

    To put it simply, for two variables x and y, if for every given value of x, y has a unique definite value corresponding to it, then we say that y is a function of x. where x is called the independent variable and y is called the dependent variable.

Related questions
10 answers2024-02-16

Fast row (the most common and the easiest).

The idea of algorithms is divide and conquer. >>>More

5 answers2024-02-16

There are no advantages or disadvantages, this algorithm is just a way to solve the problem of convergence. Advantages and disadvantages need to be compared, and there is no comparison object and the same comparison conditions, how to talk about advantages and disadvantages. There are many algorithms that can be solved for every problem, and it is not necessarily good or bad to iterate. >>>More

4 answers2024-02-16

Thinking about the vicissitudes of Chinese history, and seeing the ups and downs of some big figures, a question came up to ask and answer himself. The question is, "Who is the most pitiful person?" The answer was: "Confucius." ” >>>More

3 answers2024-02-16

==Uniform cubic b-spline interpolation **********=

Define variables: x: raw data, d: control vertices. >>>More

2 answers2024-02-16

<> Shen Kuo. 1031-1095), the character is in the middle of the book, the name Mengxi Zhangren, Han nationality, a native of Qiantang County, Hangzhou, Zhejiang, and the Northern Song Dynasty. >>>More