binary search and linear search are algorithms and as sych independent of a language like C++
I could explain it, but rather than do all that typing, I am choosing to give you links that I think explain these concepts very well
http://en.wikipedia.org/wiki/Binary_search
http://en.wikipedia.org/wiki/Linear_search
Incase, you find these confusing drop me a line and we can take it up from there
2006-09-15 02:27:18
·
answer #1
·
answered by Neil 5
·
0⤊
0⤋
"Binary Search":In computer science, binary search is a search algorithm for searching a set of sorted data for a particular value. A binary search requires random access to the data being searched. In its simplest form, binary search assumes the data is sorted (usually by a sort algorithm) and takes advantage of that characteristic.
"Linear Search":Linear search is a method of how a search is performed. With a linear search, each item is examined, one at a time, in sequence, until a matching result is found.
2006-09-15 02:39:09
·
answer #2
·
answered by Anonymous
·
0⤊
0⤋
Binary Search is one type of searching of any particular value at specific location.
let's take one ex. to search value in array
After inputing values follow following process on that data
-find middle location of given criteria ex. if u enter five elements then (0+5(store it in 'n' var))/2 will give u middle location.
-in process check if entered value (for which value u are searching )is less than array[middle]
if yes then decrease the value of middle's value i.e.'n=2-1'
else check entered value (for which value u are searching )is greater than array[middle]
increase value of lowest var i.e.0+1
Now
Linear search ,it is simple sorting ,done in sequence ,mind well "Sequencial Search" is little bit different than this, in linear order (one by one i.e. 1 2 3 ...)
As compare to both of these searching Binary search will execute faster than other one , and its' readability will also increase.
I hope this ans statisfied u
if not than
sorry for this
else
Vote me
2006-09-16 06:08:04
·
answer #3
·
answered by Swati 1
·
0⤊
0⤋