What is the complexity of space? What does ' Space complexity ' mean? ------Geeksforgeeks Translation

Source: Internet
Author: User

This chapter is relatively short!

Spatial complexity (space complexity) and auxiliary spaces (auxiliary space) are often mixed, and the following are the definitions of the correct auxiliary space and spatial complexity

Auxiliary space: Additional or temporary storage space that the algorithm needs to use.

Spatial complexity: Refers to all the storage space required by the algorithm, which is determined by the size of the input data. The spatial complexity includes the secondary space and the storage space for the input.

If we want to compare the space required for several standard sorting algorithms, it is better to use the auxiliary space to analyze than the space complexity. Merge sort uses the auxiliary space of O (n). The auxiliary space of O (1) is inserted for sorting and heap sorting. But the spatial complexity of their algorithms is O (n).

What is the complexity of space? What does ' Space complexity ' mean? ------Geeksforgeeks Translation

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.