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
Helpppppppppppppppppppppp
cestrela7 [59]
Help we need help!!!
7 0
3 years ago
Read 2 more answers
In Las Vegas, Nevada, stores charge a 4.6% state sales tax and a 3.65% county sales tax. Yuki is purchasing a handbag priced at
Vitek1552 [10]

Yuki pays tax at a rate 4.6% + 3.65% = 8.25%


The total tax on the handbag is


.0825 (220) = $18.15



5 0
3 years ago
Read 2 more answers
Cody can walk 1/3​ of a mile in 1/6​ of an hour. How many miles can he walk in 2 1/3 hours ​if he continues at the same pace?
shepuryov [24]

Answer: 14/3 miles

Step-by-step explanation: Miles divided by hours gives speed

1/3÷1/6 = 2 mph

Distance= speed × time

2 1/3 is 7/3 7/3×2 = 14/3

7 0
3 years ago
Read 2 more answers
What is $200.00 $85.00 $25.34 from least to greatest?
Assoli18 [71]

from Least to Greatest:

$25.34 < $85.00 < $200.00

4 0
3 years ago
Solve the simultaneous equations​
nexus9112 [7]

Answer:

Step-by-step explanation:

2x + 3y = 2

x = 2 - 3y /2

x + y = 0

substitute the value of x

\frac{2 \\- 3y}{2} + y = 0

2 - 3y + 2y = 0

2 = y

again,substitute the value of y

x = 2 - 3y / 2

=2 - 3*2 / 2

=2 - 6 / 2

=-2

6 0
3 years ago
Other questions:
  • Divide the polynomial x^3+x^2-2x+3 by (x-1)​
    15·1 answer
  • if a plane leave the ski resort every hour. the first plane leaves at 10 and the second plane leaves at 4 how man planes leave e
    11·1 answer
  • What is 107,609 decided by 72
    9·2 answers
  • What is the slope of this line?<br> A) 3<br> B) -3<br> C) 1/3<br> D) -1/3
    12·2 answers
  • What is the volume of this prism
    15·2 answers
  • 18 - (-6x) - 3 + 8x<br><br> simplify the expression
    9·1 answer
  • HELP!!!!!!<br><br> Define each of the following:<br> Population<br> Random sample<br> Inference
    9·1 answer
  • What is the length of Vz?<br> 2 units<br> 6 units<br> 8 units<br> 10 units
    15·1 answer
  • Simplify. 46 4 x 4 x 4 x 4 x 4 x 4 6 x 6 x 6 x 6 4 + 4 + 4 + 4 + 4 + 4 6 + 6 + 6 + 6
    8·1 answer
  • What is the value of x, y, and z?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!