DEV Community

Discussion on: Explain Pseudocode

zeerorg profile image
Rishabh Gupta • Edited

There is no single set way to write pseudocode. Even in traditional books you'll find various different ways it has been done. CLRS has pseudocode implementation very much similar to your first attempt.

I'd say any pseudocode has mainly 2 properties:

  1. It should be easy to read
  2. It should be easy to understand what it is doing

I'd say both the attempts are correct, since there are no fixed guidelines to writing pseudocode.