Let's say we have apps which can be installed on a system. Each app requires d bytes of space while downloading and takes ups bytes of space after the download is complete. Notice that, to install an app, we need at least max(d, s) bytes of space available. All three cases are possible: d s.
Example: - (d1, s1) (d2, s2)
(3, 4) and (5, 7)
Assuming the system can handle the storage space of both apps, we should try to minimize the temporary space needed while the second app is downloading. If i is installed first, how much space is needed while j is downloading? What if j is installed first?
- memory graph
1,2 -> 3,4,9, 11
2,1 -> 5,7, 10,11