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
Write the algorithm for finding the perimeter of a rectangle using English like form step by step
olya-2409 [2.1K]
L+L+W+W= Permiter
Or Lenght+Lenght+Width+Width= Perimeter
That’s all just add all the 4 sides
8 0
3 years ago
Which of the following correctly declares and initializes a Scanner object that will use input from the keyboard as its data sou
zepelin [54]
Option 4 is correct.........
5 0
3 years ago
Read 2 more answers
Community gardens are public gardens where local residents can grow plants in a plot. They are very popular, so there are often
Black_prince [1.1K]

Answer:

The information obtained is

  • Figure out who has been waiting the longest
  • Make a map of the waitlisted people

Explanation:

The information obtained from the combine data set is as follows

  • Figure out who has been waiting the longest
  • Make a map of the waitlisted people

The information from the waitlist database is combined thus the overall wait time of  the participants is estimated. Also the map of people around the globe is also made possible on the basis of the second database.

4 0
4 years ago
Select the correct navigational path to sort data using multiple levels.
gavmur [86]

Answer:

Data, Sort and Filter, Sort.

Explanation:

Just did the test.

5 0
3 years ago
Read 2 more answers
Choose the correct statement:_______.
olga2289 [7]

Answer:

d. A String is a class data type so a String variable holds a reference to a location in memory

It depends on which programing language or scripting language...

Explanation:

If it's Java then D is the correct answer...

6 0
3 years ago
Other questions:
  • A. When executing System.out.println(a1), the toString() method in the Object class is invoked.
    14·1 answer
  • If you want to conserve ink or toner, you can instruct PowerPoint to print ____ documents.
    10·1 answer
  • I want to message someone on Brainly but it wont let me. How many questions do I need to answer before I could message?
    12·2 answers
  • In which type of land contract does the seller earn interest on the difference between what the seller owes on an existing loan
    14·1 answer
  • Respecting yourself and others, educating yourself and connecting with others, and protecting yourself and others are all aspect
    11·1 answer
  • What does Nicholas Carr suggest in his article "Is Google Making Us
    7·1 answer
  • The ____ object can trigger a selectedindexchanged event when a selection is made
    5·1 answer
  • PLEASE HELP!!!
    11·2 answers
  • The Internet:
    12·1 answer
  • What is the first thing you should do when you open a savings account
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!