The memory requirements, in KB, for eight computer files are given below.
43 \quad 172 \quad 536 \quad 17 \quad 314 \quad 462 \quad 220 \quad 231
The files are to be grouped into folders. No folder is to contain more than 1000 KB, so that the folders are small enough to transfer easily between machines.
- Use the first-fit method to group the files into folders. [3]
- Use the first-fit decreasing method to group the files into folders. [3]
First-fit decreasing is a quadratic order algorithm.
- A computer takes 1.3 seconds to apply first-fit decreasing to a list of 500 numbers. Approximately how long will it take to apply first-fit decreasing to a list of 5000 numbers? [2]