Chapter 65 Algorithm and Program Completion
The following will send you a rough algorithm flow chart, and you can put forward suggestions for modification.
I believe you have also noticed that in each room of the guest house, a computer is assigned, and it has been connected to the Internet, if you have any needs, please tell the security guard at the entrance of the building directly.
During this period, everything is confidential, without permission, absolutely no contact with the outside world, no going out, no visitors are allowed, and the guest house is closed.
After the narrator finished speaking, he was about to turn around and leave, but a security guard stopped him, pointed at Zhang Yi, and whispered.
He immediately turned around and walked back to Zhang Yi's side, and asked politely, "This classmate, do you have a mobile phone?"
"Yes!" Zhang Yi replied as he took out his phone.
"I'm sorry, can we keep your phone for you temporarily?"
When Zhang Yi saw such a scene, he couldn't stop complaining: Can I say no?
Shrugged his shoulders, turned off his phone, and handed it to the other person.
When I got this mobile phone, the explainer was a little surprised, obviously, this mobile phone is different from the one on the market, the kind of super big brick, it seems much smaller and exquisite, I believe it is also expensive, I really can't see it, such a young age of college students, can buy such a good mobile phone, think about it, is a rich second generation!
Just as the narrator was about to turn around and leave, Zhang Yi suddenly asked, "If you can complete this procedure quickly, can you leave early?"
"Of course, the sooner we finish it, the more time we have, the greater the likelihood of success, and the less damage it will cause to the country. ”
Looking at the slightly immature but confident face in front of him, the narrator was stunned, could he solve this big trouble quickly? Unlikely!
Zhang Yi looked at the explainer who was gradually moving away, and couldn't help but smile easily: For you, this may be a big problem. For me, huh!
Holding the issued document, he read it carefully, for him now, although he can't do it yet, but it's almost there, and he basically wrote down all the algorithms and variables in it.
The algorithm uses the enumeration method, one of the most basic algorithms, the idea of the enumeration algorithm is: to list all the possible answers to the problem one by one, and then judge whether the answer is suitable according to the conditions, keep the appropriate one, and discard the inappropriate.
In C, the enumeration algorithm is generally implemented using a while loop. The basic idea of using the enumeration algorithm to solve the problem is as follows: determine the enumeration object, enumeration scope, and judgment conditions. List the possible solutions one by one and verify that each solution is the solution to the problem.
Enumeration solves the problem, but the problem is that the algorithm is too inefficient and pursues exact values.
The point is that the number of fragments is too large, and if you rely on this kind of accurate calculation, the calculation may not be completed when the impact occurs.
What is required above is not to completely avoid the impact, but only to use the limited satellite fuel to carry out the minimum orbit change to avoid the impact that will cause the most damage to the satellite. So the enumeration method is fine, but it is not suitable as a basic algorithm for calculating celestial running programs.
In the mind, in the developed brain domain, the brainwave search is like a radar, constantly scanning rapidly.
There are many algorithms, but they may not be suitable for the current situation, and in any case, the enumeration method is absolutely not up to the mark.
Yes, this algorithm is good, and in GitHub's vast source code repository, he found a suitable one.
Greedy algorithm: Starting from an initial solution of the problem, gradually approaching a given goal, in order to find a better solution as soon as possible. When a certain step in the algorithm is reached and it is no longer possible to move forward, the algorithm is stopped and an approximate solution is given. This approximate solution is infinitely close to the exact value.
Start by building a mathematical model to describe the problem. The solved problem is then divided into sub-problems. Each sub-problem is solved to obtain the local optimal solution of the sub-problem. Merge the local optimal solution of the subproblem into a solution of the original solution.
Such an algorithm maximizes the performance of computer multi-threading to solve the problem as quickly as possible. It is most suitable for the current situation.
I took out the manuscript paper, and I completed the flow chart of the algorithm at a fast speed.
With the algorithm, there is the soul of the program. Considering the difference in the operation of celestial bodies, the parameter variables of the orbit are all double-precision floating-point type, which ensures the accuracy of the calculation to the greatest extent.
Turn on the computer, run the Tubor C compiler that has been installed on the desktop, and do not start writing the source program directly, but just create a new .h library file, and get a library file for the operation of a computational celestial body in the development of the brain domain, almost like copying, copy the code searched in your mind to the computer in front of you, check it again, and habitually do encryption and decompilation.
With this library file, almost all the functions required by the celestial runtime are included one by one, and all he has to do is to determine the variables, call the library functions, and complete the functions required by the block diagram. It's like writing an article, the outline and framework are complete, it's nothing more than using language to make it flesh and blood.
The program is written like a smooth stream. In less than a day, it was basically completed.
Considering the serious consequences caused by program bugs, Zhang Yi cautiously used his own test program to rigorously test many times and fix some potential bugs.
In fact, with his current level of brain domain development, super memory, and C language programming level that far surpasses everyone else, it is unlikely that there will be program bugs.
Although the program has been completed, he has not submitted it, and if he solves the problem so quickly, will he be dissected like a guinea pig, or safety first.
Just using the extra time, Zhang Yi completed the education version of the micro hardware input method, and the education version of the micro hardware compression software.
The research teams gathered from all over the world still meet in the morning every day to discuss algorithms and exchange progress.
Zhang Yi will participate in every meeting, and actively hold the manuscript paper and record it from time to time. I feel like a serious student, and I just follow the same path, and I don't show my own special at all.
On the manuscript paper, there are a bunch of software content, including drawing software, music and video players, office software, invoicing systems, all-in-one integrated programming software IDE, book readers, etc., which are completely unrelated to the content of the conference.
When the algorithms and software required above have been completed, it is purely a complete waste of time to come here to listen to the meeting, but he understands that the wood is beautiful in the forest, and the wind will destroy it, and he is not here to be in the limelight, and he has nothing to do.