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
Try making a character (string) variable and a logical variable . Try creating a variable with a "missing" value NA. You can cal
quester [9]

Answer:

The solution code is written in R script.

  1. #string variable
  2. character_str<- "Hello World"
  3. #logical variable
  4. logic <-  a > b
  5. #Missing value
  6. myVec <-c(1, 2, 3, NA)
  7. #Use class to check data type
  8. class(character_str)
  9. class(logic)
  10. class(myVec)

Explanation:

A string variable is a variable that hold a string (the letters enclosed within quotation marks) (Line 2)

A logical variable is a variable that hold a logical value (either True or False). The logical value is created by comparing two variables (Line 5).

In R, missing value is an unknown value which is represented by NA symbol (Line 8).  

We can use in-built method <em>class </em> to check for the variable type in R (Line 11-13). For example, the output of <em>class(character_str)</em> is "<em>character</em>"

8 0
3 years ago
Write the code to call the function named send_signal. there are no parameters for this function.
nikklg [1K]

<em>*Assuming JavaScript</em>

Answer:

function send_signal() {}

send_signal() // calls the function

Explanation:

3 0
2 years ago
What type of bus does PCI use?
Vera_Pavlovna [14]

Answer:

PCI uses a 32-bit or 64-bit parallel bus.

8 0
2 years ago
when you are editing a word precessing document, what will tell the word processing program where in the document you are making
vfiekz [6]
You are usually editing a word document when you are finished typing up and assignment or what not, then highlighting what you want to edit will tell the computer/word document what and where your making your edits.
4 0
2 years ago
Cathy designed a website for a cereal brand. When users view the website, their eyes first fall on the brand name, then they vie
PSYCHO15rus [73]

Answer:

dominance

Explanation:

i just took it and got it right

4 0
2 years ago
Other questions:
  • Why is wearable technology important?
    12·1 answer
  • 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
  • Original Problem statement from the Text: A retail company must file a monthly sales tax report listing the sales for the month
    7·1 answer
  • Which one of the following is a correct declaration for a method named passAList that has as arguments an array list myList of s
    8·1 answer
  • Your employer is opening a new location, and the IT director has assigned you the task of calculating the subnet numbers for the
    14·1 answer
  • Each of the outcomes listed below is a result of executing the following script except for one. Which one? CREATE ROLE ExampleRo
    6·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    13·1 answer
  • Is amazon a e-commerce website <br> o true <br> o false
    8·2 answers
  • How scientist and technology beliefs society
    14·1 answer
  • What are the top 10 most dangerous computer viruses ?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!