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
Display flight number, origin, destination, fl_orig_time as --"Departure Time", fl_dest_time as "Arrival Time". Format times in
NARA [144]

Answer:

Select "flight number", origin, destination, format(fl_orig_time, 'HH:mm' ) as "Departure Time", format(fl_dest_time, 'HH:mm') as "Arrival Time" from table_name order by flight_number

Explanation:

The script is used to select records from the table named 'table_name' and formatted to 24hr time format with the hour in capital letters (signifying 24 hrs). Then the inverted comma used for flight number is due to the space character ebtween the two words. In a select statement, order by comes after the table name. While as is used as an alias for a column in a table.

8 0
3 years ago
What are the names of different types of tablets<br>​
jekas [21]

Answer:

iPad

IPad mini

IPad Pro

IPad air

Samsung Galaxy tab

Galaxy Tab e

galaxy tab pro

Galaxy tab 2

Explanation:

Also maybe could you look at my 3 biology questions i really need help

5 0
2 years ago
The windows troubleshooting utility that identifies and eliminates nonessential files is called _____.
Virty [35]
I think it is Defragment
8 0
3 years ago
Read 2 more answers
What are the two ways to use the help menu
neonofarm [45]
What help menu are you talking about?
6 0
3 years ago
Read 2 more answers
Computer in country development explain explain explain in presentation.<br>​
yaroslaw [1]

Answer:

A computer is a machine that can be programmed to carry out sequences of arithmetic or logical operations automatically. Modern computers can perform generic sets of operations known as programs. These programs enable computers to perform a wide range of tasks. A computer system is a "complete" computer that includes the hardware, operating system (main software), and peripheral equipment needed and used for "full" operation. This term may also refer to a group of computers that are linked and function together, such as a computer network or computer cluster

6 0
2 years ago
Other questions:
  • What component of a motherboard is not considered to be a field replaceable unit?
    12·1 answer
  • Is it just me or is brainly not working right now? I am trying to add friends and it won't let me!
    5·2 answers
  • The date June 10, 1960, is special because when it is written in the following format, the month times the day equals the year:
    5·1 answer
  • An algorithm written out in plain English statements is called __________.
    8·1 answer
  • Help me find the difference between these logos
    10·2 answers
  • Factoring of integers. Write a python program that asks the user for an integer and then prints out all its factors. For example
    13·1 answer
  • Edhesive 3.5 code practice quetion one
    9·1 answer
  • Lily obtained data from five trails 50 kcal 72 kcal 12 kcal and 50 kcal which best decribes her data
    11·1 answer
  • Java question
    15·1 answer
  • Say true or false
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!