Multiway branch
A multiway branch is a computer science term used to describe the change to a programs control flow based upon a value matching a selected criteria. It is a form of conditional statement. A multiway branch is often the most efficient method of passing control to one of a set of program labels, especially if an index has been created beforehand from the raw data.
Examples
Quotations
Multiway branching is an important programming technique which is all too often replaced by an inefficient sequence of if tests. Peter Naur recently wrote me that he considers the use of tables to control program flow as a basic idea of computer science that has been nearly forgotten; but he expects it will be ripe for rediscovery any day now. It is the key to efficiency in all the best compilers I have studied.
—
- "Structured Programming with go to Statements" by Donald Knuth
External links
- Coding Multiway Branches Using Customized Hash functions by H. G. Dietz
- Learning Python By Mark Lutz
- Programming in C++ By Nell B. Dale, Chip Weems