Data is moved from the large file into two (min 3 when using PFD) external drives
Finding the PFD
The following Fibonacci numbers of order 3 are found by adding the 3 previous numbers together.
F1 | T1 | T2 | T3 |
1 | 1 | 0 | 0 |
3 | 1 | 1 | 1 |
5 | 2 | 2 | 1 |
9 | 4 | 3 | 2 |
An alternative method for finding the next row of numbers is:
F1 | T1 | T2 | T3 |
9 | 4 | 3 | 2 |
an | bn | cn | |
an+bn | bn+cn | an | |
17 | 7 | 6 | 4 |
If the number of records wo be sorted is 12 and the PFD order is 3, the Fibonacci number 17 must be used.
Dummy records can be added to the beginning of the file or the end.
Example Run:
PDF Menu
Enter the file size: 10001
PFD of order: 7
Sort # | F1 | T1 | T2 | T3 | T4 | T5 | T6 | T7 |
---|---|---|---|---|---|---|---|---|
10001 | -- | -- | -- | -- | -- | -- | -- | |
1 | -- | 2000 | 1984 | 1952 | 1888 | 1761 | 1508 | 1004 |
2 | 1004 | 996 | 980 | 948 | 884 | 757 | 504 | -- |
3 | 500 | 492 | 476 | 444 | 380 | 253 | -- | 504 |
4 | 247 | 239 | 223 | 191 | 127 | -- | 253 | 251 |
5 | 120 | 112 | 96 | 64 | -- | 127 | 126 | 124 |
6 | 56 | 48 | 32 | -- | 64 | 63 | 62 | 60 |
7 | 24 | 16 | -- | 32 | 32 | 31 | 30 | 28 |
8 | 8 | -- | 16 | 16 | 16 | 15 | 14 | 12 |
9 | -- | 8 | 8 | 8 | 8 | 7 | 6 | 4 |
10 | 4 | 4 | 4 | 4 | 4 | 3 | 2 | -- |
11 | 2 | 2 | 2 | 2 | 2 | 1 | -- | 2 |
12 | 1 | 1 | 1 | 1 | 1 | -- | 1 | 1 |
13 | -- | -- | -- | -- | -- | 1 | -- | -- |