This section contains 640 words (approx. 3 pages at 300 words per page) |
Computers always execute programs in a fixed, sequential order only, with no intelligent choice or discretion. Most algorithms, however, require the application of certain procedures or execution of certain blocks of code repeatedly--for instance, the sorting of an array usually involves recursive application of the sort procedure a number of times. When an algorithm which asks for such repetition is translated into a program that is executed in sequential order, the tendency of computers to execute in strict sequential order must be altered on purpose--this is done by specifying "branches" or other instructions.
Branches are of two kinds, conditional or unconditional. A conditional branch has the form, "Check for this condition to be true; if it is, then do the following." A conditional branch thus causes execution to jump to a specific block of code if a certain condition is fulfilled. In commonly used programming languages...
This section contains 640 words (approx. 3 pages at 300 words per page) |