-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.txt
77 lines (67 loc) · 3.15 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/******************************************************************************
* Name: Kyle Ferrigan
* NetID: kbferrigan
* Precept: N/A
*
* Partner Name: Patrick Galati
* Partner NetID: pagalati
* Partner Precept: N/A
*
* Operating system: Kyle: MacOS; Patrick: Win10
* Compiler: Kyle: JetBrains IntelliJ IDEA; Patrick: Netbeans
* Text editor / IDE: Kyle: JetBrains IntelliJ IDEA; Patrick: Netbeans
*
* Have you taken (part of) this course before:
* Kyle: No; Patrick: No
* Hours to complete assignment (optional):
* 6 hours each
******************************************************************************/
Programming Assignment 2
/******************************************************************************
* Known bugs / limitations.
*****************************************************************************/
If a file bigger than 1GB is inserted, will cause the Disk to say it has negative size remaining.
/******************************************************************************
* Describe whatever help (if any) that you received.
* Don't include readings, lectures, and precepts, but do
* include any help from people (including
* classmates and friends) and attribute them by name.
*****************************************************************************/
N/A
/******************************************************************************
* Describe any serious problems you encountered.
*****************************************************************************/
How to properly implement MaxPQ
/******************************************************************************
* Unsorted vs Sorted Performance
*****************************************************************************/
SORTED
Sum of all files: 7.288108 GB
Disks Used: 8
7 301705: 213357 137913 123456 112358 111211
6 192458: 304266 261260 242016
5 61989: 469101 468910
1 55925: 708364 235711
0 54452: 721082 224466
4 21926: 621283 356791
3 19779: 628496 351725
2 3658: 654321 342021
UNSORTED
Sum of all files: 7.288108 GB
Disks Used: 9
8 657979: 342021
7 278918: 721082
3 269639: 469101 261260
1 207766: 654321 137913
4 115613: 468910 111211 304266
0 90652: 123456 224466 112358 235711 213357
5 49620: 708364 242016
6 21926: 621283 356791
2 19779: 351725 628496
With the unsorted files using the worst fit heuristic our results show it uses more files than the sorted decreasing worst fit heuristic. You can notice that it follows the insert schema when the earliest disk IDs used in the Unsorted method is reading the text file from top to bottom. With the Sorted method, we can avoid the unnessary wasted space by properly inserting the file sizes to appropiate disk IDs to maximize disk usage.
/******************************************************************************
* List any other comments here. Feel free to provide any feedback
* on how much you learned from doing the assignment, and whether
* you enjoyed doing it.
*****************************************************************************/
The difference of disk space usage was interesting to visually see.