Traditional Culture Encyclopedia - Traditional culture - What are the methods of representing algorithms
What are the methods of representing algorithms
The representations of algorithms are: natural language, traditional flowcharts, pseudo-code, structured flowcharts (N_S flowcharts, box diagrams).
1. Natural Language Description of Algorithms
It is a way of describing algorithms, which expresses the process of running the algorithm and the results through natural language. Although describing algorithms in natural language is more intuitive and easy to understand, it lacks intuition and conciseness and is prone to ambiguity. This way of description is suitable for scenarios that require precise description of the algorithm's logic and running process, but in everyday use, ordinary programmers are usually more accustomed to using natural language to describe algorithms rather than directly using computer programs to describe them.
2, traditional flowchart
Traditional flowchart is a method of algorithm representation, which connects the block diagrams with a flow line to indicate the execution order of the algorithm. Through the flow line can clearly show the execution order of the algorithm, it is convenient for us to understand and describe the execution process of the algorithm.
3, pseudo-code
Pseudo-code is a kind of algorithm description between natural language and computer language, without strict syntax restrictions. Pseudo-code usually does not contain specific language structures and syntax rules, but uses simple and easy to understand keywords and symbols to express. For example, "if" means conditional judgment, "for" means loop and so on. Pseudo-code is a tool to express some ideas during the execution of an algorithm, not to execute the code itself.
An algorithm is an accurate and complete description of a solution, a clear set of instructions for solving a problem, and an algorithm represents a systematic way of describing a strategic mechanism for solving a problem. That is to say, the ability to obtain the required output in a limited time for a certain specification of input.
If an algorithm is flawed or unsuitable for a problem, executing it will not solve the problem. Different algorithms may accomplish the same task in different amounts of time, space, or efficiency. The strength of an algorithm can be measured in terms of space complexity versus time complexity.
An instruction in an algorithm describes a computation that, when run, can start from an initial state and (possibly empty) initial inputs, go through a finite and well-defined set of states, and ultimately produce an output and stop in a final state. The transfer from one state to another is not necessarily deterministic. Some algorithms, including randomized algorithms, contain some random inputs.
- Previous article:What are the three unique flavors of Tianjin snacks?
- Next article:Does China Telecom have a discount package?
- Related articles
- How to fill in the inspection lot position in the quality acceptance record of subdivisional work?
- Figure 1 is a diagram of a laboratory device for the production of ammonia. Please answer: (1) The chemical equation for the laboratory preparation of ammonia is ______. (2) The student used tweezers
- How do you get a tattoo? Trying to understand what is used for tattooing
- Puppetry Culture in Guangdong with a Long History
- What are the specifications of license plate screws?
- Why not invent a battery with thermal effect?
- Kiev is the capital of which country? Kiev is the capital of which country?
- What are the traditional festivals in Thailand (holding time)
- Typical types of organizational structure, what are the advantages and disadvantages?
- Cyan has several colors what are they