1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
zloy xaker [14]
2 years ago
12

When using the BinarySearch() method of an array or list type, what value is returned when the element is not found? How can we

decode this value and make use of it?
Computers and Technology
1 answer:
Step2247 [10]2 years ago
5 0

Answer:

When the element is not found we return -1.

Explanation:

When we use binary search we use BinarySearch() method of an array or list type when the element is found we return the index of the element if found if the element is not found we return -1.

We can decode this value since it is less than 0 and the indexing of arrays and lists starts with 0 upto the size-1.So -1 index is not present in the array or list.We have to check if the index is < 0 then the element is not present in the array or list.

for ex:-

if(index<0)

{

    System.out.println("Element is not present in the array");

}

You might be interested in
the computer that communicate with each other are called ______please ask the answer in 15 minutes after 1 p.m. ​
Elis [28]

The computers that communicate with each other are called \sf\purple{transmission \:control\: protocol\: (TCP)}.

\large\mathfrak{{\pmb{\underline{\orange{Happy\:learning }}{\orange{!}}}}}

8 0
2 years ago
Difference between ancient and modern mode of information <br> transmission
ELEN [110]
Ancient mode of transmission are used by people in the past while modern mode of transmission are used by present people
4 0
3 years ago
What to do if you click on a phishing link on iphone
gregori [183]

Answer:

Nothing, just exit out of it

Explanation:

5 0
2 years ago
Read 2 more answers
Please help.........​
natima [27]

Answer: For the first dot you can I want a playground in my community

Make homework easier I dont know foor the other two

Explanation:

6 0
2 years ago
Whats your favorite .io game (example krunker.io, gawd.io)<br> (PS FWEE PTS BOIS)
marshall27 [118]

Answer:

starve.io

Explanation:

It's basically an entire game, you can play a single run for hours and it's all new content the entire way, not to mention it's actually difficult the entire way through.

4 0
2 years ago
Other questions:
  • Given positive integer numInsects, write a while loop that prints that number doubled without reaching 200. Follow each number w
    8·1 answer
  • Show the contents of a queue after the following operations are performed. Assume the queue is initially empty. enqueue(45); enq
    6·1 answer
  • // This pseudocode is intended to display // employee net pay values. All employees have a standard // $45 deduction from their
    12·1 answer
  • Write a function SwapArrayEnds() that swaps the first and last elements of the function's array parameter. Ex: sortArray = {10,
    8·1 answer
  • Provide examples of the cost of quality based on your own experiences
    14·1 answer
  • Analytical CRM systems are the input for operational CRM systems.<br><br> True<br><br> False
    11·1 answer
  • Why are computers complicated?
    15·1 answer
  • Which statements are true? Select 4 options.
    9·1 answer
  • (Print distinct numbers) Write a program that reads in integers separated by a space in one line and displays distinct numbers i
    8·1 answer
  • Add me on f0rtnite <br> (Tsarbacon)
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!