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]
3 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]3 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
What are some limitations when it comes to testing and ensuring program quality? List at
DedPeter [7]

Answer:

the two limitation i can think about is the efficiency like if there are bugs or glitches or if it can get broken into and the second one is if it is running the correct program or not a lot of people deal with this problem.

Explanation: personally these are the two i can come up with at the moment

4 0
2 years ago
A blank operates as a standalone device and is shared by multiple users
Sedbober [7]
B.s. Hugh gingham thigh hangman
8 0
3 years ago
Read 2 more answers
If a preferred (faster) learned route over a WAN has administrative distance 110 that competes with a static backup (slower) rou
almond37 [142]

The engineer will need to set the distance to 130 for the static link so that it becomes a floating static route.

<h3>What is Floating static routes?</h3>

This is known to be a static routes that is said to have a kind of administrative distance that is also known to be bigger than the administrative distance of any other static route or dynamic routes.

Note that the value 130 stands for the next most logical value, nd as such it is to know that the right route comes first in the steps for administrative distance.

Learn more about WAN from

brainly.com/question/11352260

5 0
2 years ago
Which of the following statements are true?
grin007 [14]

Answer:

I think the answer are two which are B and C

7 0
3 years ago
Whats my screen name?
adoni [48]
It could be any thing of your chose
8 0
3 years ago
Read 2 more answers
Other questions:
  • What is requirement analysis
    8·1 answer
  • What Is the output of the following: =OR (5 &lt;7, 16*Rand ()&gt;23,FALSE)
    5·1 answer
  • Write a Console Java program that asks the user to enter one sentence on the keyboard. Output on the console:
    6·1 answer
  • A corporation needs an operating system that allows the various teams in its office to network and collaborate on projects. Whic
    10·1 answer
  • Fred wants to analyze his spending habits of the past few years and has gathered information on the checks he has written from 2
    6·1 answer
  • A website's ____ page provides basic information about the individual or organization and includes a navigation bar with links t
    13·1 answer
  • If you do not specify any criteria in a delete query, Access will delete all the records in the table. Truth or False
    11·1 answer
  • Choose the best type of loop for each situation.
    6·1 answer
  • Software que busca, detecta y elimina malware tipo espía; puede instalarse en la computadora de manera aislada o en conjunto con
    11·1 answer
  • According to Okun's law, if the unemployment rate goes from 7% to 4%, what
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!