Programming Beauty---Tape file storage optimization

Source: Internet
Author: User

To define the nth file on a tape, you need to go through the previous n-1 file. Suppose there are n files on the tape, l[0],l[1], ..., l[n-1] and the probability of being accessed is p[0],p[1],..., p[n-1], how do you arrange for the best storage order on tape?

The thinking process is: from the assumption that the probability is equal, the length is different, we can get the best access efficiency according to the file length from short to long to store the file on tape. Then, assuming the same length, the probabilities vary, and it is best to rank files from large to small by access probability. Best, the lengths and probabilities are different, and the values of p[i]/l[i] are the best order of storage, ranging from large to small.

Programming Beauty---Tape file storage optimization

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.