Hi All, I am reading algorithms in C++ by Robert Sedwick it was mentioned as follows
Sequential search in an ordered table examines N numbers for each search in the worst case and about N/2 numbers for each search on average.
This result follows from assuming that the search is equally
likely to terminate at any one of the N+1 intervals defined by the N numbers in th table which leads immediately to the expression (1+2+3+4+...+N+N)/N = (N+3)/2.
Can any one please help me in understand how we came to above expression i.e., how N+3 /2 is arrived.
Thanks in advance Venkata