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
Plz
allsm [11]
Top box is 2x
bottom box is 3
4 0
3 years ago
Solve simultaneous equations 3x-2y=17 +2x-2y=10
Zarrin [17]

Answer:

(7;2)

Step-by-step explanation:

3x - 2y  = 17 \\  - 2y = 17 - 3x \\ 2x + 17 - 3x = 10 \\ 2x - 3x = 10 - 17 \\  - x =  - 7 \\ x = 7 \\  - 2y = 17 - 21 \\  - 2y =  - 4 \\ y = 2

3 0
3 years ago
Question 3 Please. I'm really stuck :(
Stells [14]
Let ∠RTS=∠RST = a (say)
 ∠QUA=∠QSU= b(say)
then we know , at point S, a+40+b=180. so, a+b=140 we'll use this later.

consider trianglePQR, ∠P+∠Q+∠R=180
i.e.P+(180-2b)+(180-2a)=180
P+180+180-2(a+b)=180 ⇒P+180-2(a+b)=0 ⇒P=2(140)- 180=280-180=100
hence,answer is E
7 0
2 years ago
Read 2 more answers
Josh works for The Milkshake Diner. The company wants to know which milkshake flavor is the most popular. Today, he surveyed
AlekseyPX

its b i think please vote me i need points

6 0
3 years ago
Calculate: 3400*6 1/2 *1/100​
marishachu [46]

questions clear likhh

thank for extra points

7 0
3 years ago
Other questions:
  • The difference of a number times 4 and 9 equals 5
    14·2 answers
  • This makes no sense can someone please explain.
    7·1 answer
  • Chad created a table that shows the ratio of his role playing game cards.
    9·2 answers
  • Part a complete the equation for the perimeter of this rectangle p=2( )+2( )
    12·1 answer
  • Which shows the correct substitution of the values a,b,and c from the equation 0=4x^2+2x-1 into the quadratic formula below
    10·2 answers
  • A football team is at its own 25-yard line. In the next three plays, it loses an average of 4 yards per play. Where is the team
    13·2 answers
  • All points on the circle are the same distance away from the circles ____
    10·1 answer
  • The histogram represents the distributions of boiling temperatures, in degrees Celsius, of tap water and a mixture of salt water
    5·1 answer
  • The aquarium has 6 fewer yellow fish than green fish. 40 percent of the fish are yellow. How many green fish are in the aquarium
    14·1 answer
  • PLEASE HELP WILL GIVE BRAINLY AND 5.0 RATING
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!