Structured Programming  «Prev  Next»
Lesson 1

Introduction to Computer Algorithms

In this module you will learn what a computer program is and the environment in which it performs its work.
We will explore what a program looks like to the programmer, what it looks like to the computer, and how it gets from the language of the programmer to the language of the computer.
By the end of this module, you will be able to:
  1. Define computer programs
  2. List and describe the components of a computer
  3. Describe the role of an operating system
  4. Describe what happens when a computer program is executed
  5. Explain what machine language is
  6. Explain what compilers and interpreters do
In the next lesson the concept of computer program will be explained.

Computer program

A computer program is a collection of instructions that performs a specific task when executed by a computer. A computer requires programs to function, and typically executes the program's instructions in a central processing unit.
A computer program is usually written by a computer programmer in a programming language like C++ or Java. From the program in its human-readable form of source code, a compiler can derive machine code, a form consisting of instructions that the computer can directly execute. Alternatively, a computer program may be executed with the aid of an interpreter. A part of a computer program that performs a well-defined task is known as an algorithm. A collection of computer programs, libraries and related data are referred to as software. Computer programs may be categorized along functional lines, such as application software or system software.

Sharing of Programs

The sharing of programs in computer systems is becoming more widespread, so although we might expect to be using a large fraction of the algorithms in this course, we also might expect to have to implement only a small fraction of them. For example, the Java libraries contain implementations of a host of fundamental algorithms. However, implementing simple versions of basic algorithms helps us to understand them better and thus to more effectively use and tune advanced versions from a library. More important, the opportunity to reimplement basic algorithms arises frequently. The primary reason to do so is that we are faced, all too often, with completely new computing environments (hardware and software) with new features that old implementations may not use to best advantage. In this course, we concentrate on the simplest reasonable implementations of the best algorithms. We do pay careful attention to coding the critical parts of the algorithms, and take pains to note where low-level optimization effort could be most beneficial.