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
VMariaS [17]
3 years ago
6

Let t[1..n] be a sorted array of distinct integers, some of which may be negative. give an algorithm that can find an index i su

ch that 1 i n and t[i] = i
Mathematics
1 answer:
lisabon 2012 [21]3 years ago
8 0
Assuming we need to find i such that 
1 ≤ i ≤ n  and t[i]=i.

If we need to find only the first occurrence, we can do:

for i:1 to n {
    if t[i]=i then return(i)
}

If exhaustive search is required, then put the results (values of i) in an array or a linked list, return the number of values found, and the array (or linked list).


You might be interested in
If y = kx, what is the value of k if y = 20 and x = 0.4?
True [87]
Set up an equation 20=k(0.4)....to find k divide 20 by 0.4
8 0
3 years ago
Please help been stuck on this for 40 minutes
choli [55]

we have given y interms of x.

we have given that add 2 to x.

which means y=x+2

so we have x=2 ,y=x+2=2+2=4.

so when x=2 ,y=4.

x=4,y=x+4=4+2=6..

y=x+2,y=6+2=8.

3 0
3 years ago
Read 2 more answers
How Do You Do The Math Questions
Ray Of Light [21]
1.A 2.B hope this helps
7 0
3 years ago
You and three friends go out to eat and decide to split the bill evenly. The food you order comes to a total of $48. If you leav
zloy xaker [14]

Answer:

11.64

Step-by-step explanation:

100%-> 48

15%-> 7.20

6.25%-> 3

48+7.20+3=58.20

58.20÷5=11.64

4 0
3 years ago
Can any one please help me in number 4 please I really need help please
Reil [10]

Answer:

24

Step-by-step explanation:

4 0
3 years ago
Other questions:
  • Which product is positive?
    6·1 answer
  • Seth traveled 1 mile in 57.1 seconds. About how fast does Seth travel in miles per hour? an exact answer not an estimate, and ex
    9·2 answers
  • If each slice of pizza is 1/16 of the pizza what is the decimal form of 8 slices of pizza
    5·1 answer
  • PLEASE HELP ILL GIVE U BRAINLEST PLUS 50 POINTS IF U GET IT RIGHT
    5·1 answer
  • Please help and give explanation
    10·1 answer
  • Simplify the equality 2y>4
    5·2 answers
  • What is The slope of the line passes through (0,-3) and (2,13).
    13·1 answer
  • Consider a sample with data values of 27, 25, 20, 15, 30, 34, 28, and 25. Compute the range, interquartile range, variance, and
    11·1 answer
  • Answer fast please and thank you
    12·1 answer
  • A nutritionist wants to know how the taste of artificial sweeteners impacts food choices of diabetic patients. From which group
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!