Parallelism:
The state of being parallel and having correspondence among them is referred as parallelism. Two or more tasks can be performed simultaneously, without affecting the performance of the either one.
Given Information:
It is given that for a binary search
Given code statement:
//Binary Search algorithm
//Array and number is passed as parameter
BinarySearch(A[0..N-1], X) {
//low is assigned as "0"
low = 0
//high is assigned as last number-1
high = N - 1
while (low <= high) {
//find middle number
mid = (low + high) / 2
/* check is mid is greater than "x" */
if (A[mid] > X)
/* assign high left to mid */
high = mid - 1
elseif (A[mid] < X)
/*assign low right to the mid */
low = mid + 1
else
// found
return mid
}
//not found
return -1
}
Want to see the full answer?
Check out a sample textbook solutionChapter 6 Solutions
COMPUTER ORGANIZATION+DESIGN >I<
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY