Open the file data.txt. You will see three sequences of numbers. All the sequences end in 1. Notice that there are comments, read them.
You have to replace two of the sequences with your own sequences. Your sequences must be based on some equation or relationship that you can explain briefly in the comment. You should also change the name of the sequence to suit.
The sequence should produce a result that is better than Shell, and as close to Sedgewick as possible. You are not graded on how good your sequence is, just on how inventive you were. You can also use the internet to help you find sequences. Run the exe file to read the data.txt and create the edit1.txt file, then use DSWB to read the edit1.txt file to produce the graphs. Send me the data.txt file. This Video would help you to understand this more.http://screencast.com/t/q6EBDbSjb
Important:please make sure you comment as to what the sequences signify
Lab X/data.txt 3 //number of increment sets
50 //first increment (followed by others in descending order stopping at 1)
25
13
6
3
1 // the 1 must be there because the program expects it.
My Shell increments // title of first graph
// end of first increment sets data (if a line ia a comment or spacer, the // must start at column 0)
5 // first increment in the second set
3
1 // the 1 must be there because the program expects it.
My 531 increments // title of second graph
//
16001 // first increment in the third set
8929
3905
2161
929
505
209
109
41
19
5
1 // the 1 must be there because the program expects it.
My Segw increments // title of third graph
$ // teminating char (you don’t really need it but it forces you to have CRLF in the line above
Lab X/data_sample.txt 3 //number of increment sets
50 //first increment (followed by others in descending order stopping at 1)
25
13
6
3
1 // the 1 must be there because the program expects it.
My Shell increments // title of first graph
// end of first increment sets data (if a line ia a comment or spacer, the // must start at column 0)
5 // first increment in the second set
3
1 // the 1 must be there because the program expects it.
My 531 increments // title of second graph
//
16001 // first increment in the third set
8929
3905
2161
929
505
209
109
41
19
5
1 // the 1 must be there because the program expects it.
My Segw increments // title of third graph
$ // teminating char (you don’t really need it but it forces you to have CRLF in the line above
Lab X/DSWB_2011.exe
Lab X/edit1.txt 8 16
Sort Increments
Shell|Hibbard|Sedgewick|531|Increment|My Shell increments |My 531 increments |My Segw increments |
Sample Size(N)
Operations
01234567890
01234567890
loglog
8 16 32 48 64 96 128 256 512 1024 2048 3072 4096 8192 16384 32768
24 80 199 442 654 1007 1519 5060 9567 30315 84217 140042 171335 564406 1116438 3907933
18 59 177 297 457 779 1193 2869 6437 16561…





