« [ Back to Home ] »
<< Return to Computer Dictionary Home
 

Send this page to a friend

.

 

Computer Dictionary Online

Search Computer Term Definition

Web Bestonlinedictionary.com

[ Law Dictionary ] [ Financial Dictionary ] [ Medical Dictionary ] [ Computer Dictionary ]

Computer Dictionary

A to Z Computer Terms Dictionary, Definitions Search

| 0-9 | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q |
|
R | S | T | U | V | W | X | Y | Z |
 

lamp-post error ==>

fencepost error definition

1. (Rarely "lamp-post error") A problem with the discrete equivalent of a boundary condition, often exhibited in programs by iterative loops. From the following problem: "If you build a fence 100 feet long with posts 10 feet apart, how many posts do you need?" (Either 9 or 11 is a better answer than the obvious 10).

For example, suppose you have a long list or array of items, and want to process items m through n; how many items are there? The obvious answer is n - m, but that is off by one; the right answer is n - m + 1. The "obvious" formula exhibits a fencepost error.

See also zeroth and note that not all off-by-one errors are fencepost errors. The game of Musical Chairs involves a catastrophic off-by-one error where N people try to sit in N - 1 chairs, but it's not a fencepost error. Fencepost errors come from counting things rather than the spaces between them, or vice versa, or by neglecting to consider whether one should count one or both ends of a row.

2. (Rare) An error induced by unexpected regularities in input values, which can (for instance) completely thwart a theoretically efficient binary tree or hash coding implementation. The error here involves the difference between expected and worst case behaviours of an algorithm.

[Jargon File]

(1994-12-01)

 


Nearby terms: FEL « femto- « fence « fencepost error » fepped out » FEPROM » Fermat prime
 
 
 
<< Return to Computer Dictionary Home Page
 


 

computer dictionary, computer terms dictionary, online computer dictionary, computer definition dictionary online, microsoft computer dictionary fifth edition, computer lingo dictionary, computer terminology dictionary, computer computer dictionary dictionary internet internet terms terms, barrons business computer dictionary dictionary internet terms, abbreviation computer dictionary lingo, computer dictionary edition new tenth websters world, computer dictionary with terms and definition, computer science dictionary, american computer dictionary house language random sign websters, dictionary computer internet terms, microsoft computer dictionary, computing dictionary

[ Home ] [ Law Dictionary ] [ Financial Dictionary ] [ Medical Dictionary ] [ Computer Dictionary ]
 

Hot Links : Electronic Tutorials , Information Encyclopedia Directory , Science Projects , Indian Food Recipes , Hot Game Cheater , Love & Romance Attachments , Krrish Game for PC

 

Best Online Dictionary .com

 

www.bestonlinedictionary.com Copyright ® 2006, All Rights Reserved