My God! If no code is available, I am crazy .!!!
Fortunately, after so long, the Code finally came out.
Every time I write, I tell myself. I have to write some strong words after writing this ,.... as a result, no. basically... after writing it, I thought it was very dull. The process was over...
Compared with the past, the Code style has changed. I tried to use the header file, modified a queue's misunderstanding from a long time ago, reviewed the hill sorting, and learned how to select a data structure.
We are pleased with the process of selecting a data structure. according to the requirements of the questions and data requirements, I chose the queue. then, sort the pointers of each node in the queue copy to sort the queue. the running overhead is relatively large, and too many optimizations have not been attempted.
Also, I replaced 1 with 100. The floating point is actually confused. I don't know much about floating point! Let's go back and strengthen it. Let's finish the code first.
In addition, it is concluded that... you cannot worry, the more anxious, the more counterproductive...
Tired! Yesterday, I went to bed after I got home and wrote it for a while. Today I wrote it all the time. Although there was a slide in the middle, I wrote it! Tired!
Okay, paste the code.
/* Head. H -- header file */<br/> # include <stdio. h> <br/> # include <stdlib. h> </P> <p> # define quit (0) <br/> # define import_data (1) <br/> # define next_fit (2) <br/> # define first_fit (3) <br/> # define best_fit (4) <br/> # define first_fit_decreasing (5) <br/> # define best_fit_decreasing (6) <br/> # define undefinition (7) <br/> # define size (32) </P> <p> # define gross (100) </P> <p> # define false (0) <br/> # define true (1) </P> <p> typedef struct item <br/>{< br/> int current; <br/> int leavings; <br/> int gross; <br/>}item; </P> <p> typedef int bool;