Followers

Monday, November 29, 2010

Some common tech jargon:-

Hello,

What I am about to discuss are very trivial technical points for programmers, But just for the sake of Jargons :-

1) Off-by-one error (OBOE): suppose you want to traverse an array from beginning to end. lets say its size is  100. And in the implementation programming language, the index starts from zero.

The following code segment demonstrates OBOE:-

for(i=0;i<=100;i++)

{

----------------------- some code

}

We end up traversing 101 elements. the array ranges from o to 99.

Its very common in C language.

2) Fencepost Error:-

This is an error associated while answering questions such as:-

If you build a straight fence 100m long with posts 10m apart, how many posts do you need?

At first sight we would say:- 100/10 = 10 posts are needed.

But looking closely we find that the answer is ((total_length/individual_length)+1) posts are needed.

See you guys,

Bye


No comments:

Post a Comment