Complexity of Algorithms

Source: Internet
Author: User
Introduction

AlgorithmComplexityIt is a measure of algorithm efficiency and an important basis for evaluating the advantages and disadvantages of algorithms. The complexity of an algorithm lies in the number of computer resources required to run the algorithm. The more resources required, the higher the complexity of the algorithm, the lower the required resources, the lower the complexity of the algorithm.

The most important thing about computer resources is time and space (I .e. memory) resources. Therefore, the complexity of algorithms isTime ComplexityAndSpatial complexity.

It is self-evident that designing algorithms that are as complex as possible for any given problem is an important goal we are pursuing in designing algorithms. On the other hand, when there are multiple algorithms for a given problem, selecting the least complex is an important criterion for algorithm adaptation. Therefore, algorithm complexity analysis has important guiding significance and practical value for algorithm design or selection.

There are two questions about the complexity of algorithms:

  1. How can we express the complexity of an algorithm with a volume;
  2. How to calculate the complexity of a given algorithm.

Let's start by comparing the efficiency of two specific algorithms.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.