Algorithms
Comments in square brackets
eg: [End of If Structure]
Variables in Upper Case.
eg: I, J, ITEM, LOC
Equality Operator:
== written as =
Assignment Operator:
= written as :=
Assignment Expression:
eg: Set I:=0
Looping Structures:
(While Loop) eg: Repeat Steps # to # while I>=0 and ptr!=NULL
(For Loop) eg: Repeat Steps from I=N to 0 by -1
Input/Output Commands
eg: Write: LOC is the location of the Itemeg: Read: POS
Control Structures:
eg: If I>LOC then:
[process]Else if I<LOC then:
[process]Else:[process]Many Steps can be combined using commas & and
eg: Set K:=1, LOC :=1 and MAX:=99
Starting Algos with following format:
INSERT( LIST, N, ITEM, POS )
where LIST is the array list of elementsN stores the no of elements in ListITEM is the new element to InsertPOS is the position to insert new element
Step 1:Step 2:Step 3:..Step 9: Exit.