User Tools

Site Tools


computer_science:programming:algorithm

This is an old revision of the document!


Pseudocode

Simplified tradeoff between natural and programming language. Pseudocode is not unique. That is to say that it does not have rigid rules. Different people may have different pseudocode syntax.

Squential statements

  • Inputs: Get “variable”
    • Ex: get m, get radius
  • Computation: set “variable” = expression
    • Ex: set area = π*radius2
  • Output: print “variable”
    • Ex: print area

Conditional statements

Loop

do
    op1
    op2
    op3
while(condition)

* 'Do while' loops will execute at least once, online 'while' loops

computer_science/programming/algorithm.1632515161.txt.gz · Last modified: 2021/09/25 05:26 by mana