Introduction to the 1th chapter of algorithms and the choice of programming questions

Source: Internet
Author: User

Series Address: Introduction to Algorithms (CLRS) reference answers and matching programming questions

1.1 Algorithm

1.1-1 such as undergraduate semester statistics sorting to assign scholarships and so on.

1.1-2 such as the memory needed to solve the problem, and so on.

1.1-3 Sequential table, the advantage of support random lookup, you can find elements in \ (O (1) \) , the disadvantage is to add/remove elements inconvenient.

1.1-4 Similarity: All can be simulated by a graph with weighted edges to solve the total distance minimization problem.
Different: The shortest path and the travel quotient problem consider different vertex situations, resulting in different complexity.

1.1-5 only the best solution: Use the same appearance key to unlock, only the correct key can be opened.
Getting an approximate solution is also OK: the route that you take when you drive is not necessarily a straight line, but also a round.

1.2 As a technique of algorithm

1.2-1 E-Commerce Advertising recommendation system, select the most likely by the user click on the ads to recommend.

The 1.2-2 problem translates into a value that we need to determine so that $8n^2<64 n \log _2 (n) $ is established, simplifying to $ n<8 \log _2 (n) $ or $n \leq 43 $, that is, when the sort size does not exceed 43 elements, insert rows The order is better than the merge sort.

Introduction to the 1th chapter of algorithms and the choice of programming questions

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.