Algorithms and Pseudocode

The hardest part of designing a program using a language, such as C#, is not trying to work out how to express a specific algorithm in C#. The hardest part is to construct the algorithm itself. Often, complex algorithms are the result of many years of research. The majority of those complex algorithms could be implemented by a proficient C# programmer in a few hours or days.

Expressing algorithms is often facilitated through a “language” called pseudocode. To illustrate what pseudocode is and how it can be a useful way to express algorithms, consider the following situation.

An alien, from planet Blipos, is visiting earth for a brief period of time. He needs to know how the average of an arbitrary list of numbers is ...

Get C# Primer Plus now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.