CS3343/3341 Analysis of Algorithms |
Pseudocode Conventions
Intro. to Algorithms Cormen, et al. |
| Item changed | 3rd Edition | 2nd Edition |
|---|---|---|
| Start of Comment | // | ▷ |
| Keywords then and do | not present | present |
| Assignment Operator | = | ← |
| Equality Operator | == | = |
| Attributes or fields | A . length | length [A] |
| Description | Text's pseudo-code | C / Java / C++ |
|---|---|---|
| Array bounds declaration |
A[1..n] (bounds explicitly declared) |
A[n] (lower bound must be 0; upper bound is n-1) |
| for loop | for i = 1 to n | for (int i = 0; i < n; i++) |