What is the difference between a binary search and a
sequential search?

Answer Posted / boxee

binary search is fast because
it check the element mid
is element is less
it set the beg
mid=(beg+end)/2;
if(value>a[mid])
{
beg=mid+1;
}
else
{
end=mid-1;
}

Is This Answer Correct ?    23 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

i want to learn mainframe..any websites and material to learn from basic..? my mail id : rajeswaribe2010@gmail.com

1761


I have a program with an Array of 5000 occurences which is being passed from 5 sub levels to the front end screen. Thess 5 programs using each 5*2 = 10 different arrays with size as 5000. This is causing the transaction to utilize more storage consupmtion. I am looking to reduce the storage consumption. As part of that initially i thought Dynamic array may solve my problem. After viewing the comments given i see its same as normal array. IS there any other way we can resolve this issue?

1223


What are literals?

622


Name the divisions, which are available in a cobol program?

677


Hi pls anybody tell me about " ANALYSIS DOCUMENT PREPARATION AND ESTIMATION OF TASK " (in real time project)."I want to update a sequential file in my project" for that purpose i need both structures i mean analysis document and estimation of task.

1693






How do you differentiate between cobol and cobol-ii?

646


How to get the last record in vsam file in cluster? And how can you get the ksds file records into cobol program?

699


How do you get the data to code the BMS macro?

1470


What is the Purpose of POINTER Phrase in STRING command in COBOL?

711


What is the difference between external and global variables in COBOL?

806


How to traceback if I am getting SOC7 or SOC4 abend? List down the steps

558


What is the difference between perform … with test after and perform … with test before?

871


I have a File that has duplicate records. I need only those records that occur more than thrice.?

8616


) How do u handle errors in BMS macro?

1418


i have 10 names in an array and my name is one of them also array is not in sorted order i need to display my name using index how will i do this

988