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
amm1812
3 years ago
15

Suppose you have this array of five integers: int[] list {2, 5, 4, 8, 3}. if a bubble sort is being used, which index of the arr

ay will the number 8 be in after the first pass through the algorithm?
Mathematics
1 answer:
Gwar [14]3 years ago
8 0
Array list: ⇒ <span>2, 5, 4, 8, 3

</span>Sort the array from lowest number to greatest number using bubble sort.

First pass:
2 , 5 , 4 , 8 , 3 
2 , 4 , 5 , 8 , 3 ⇒⇒⇒ Swap since 5 > 4
2 , 4 , 5 , 8 , 3
2 , 4 , 5 , 3 , 8 ⇒⇒⇒ Swap since 8 > 3

∴ The index of the number 8 <span>after the first pass = 5</span>




You might be interested in
Which answer is an equation in point-slope form for the given point and slope?
STALIN [3.7K]

I just took the test. The correct answer is:



3 0
2 years ago
Read 2 more answers
what are some good Netflix show's to watch and don't say all American because i finished both seasons in a week :(..lol
Anit [1.1K]

I love Money heist. I recommend it :)

3 0
3 years ago
Read 2 more answers
| 5x -2y | - | 3x | if x = -3 and y = 2
Natalka [10]

Answer:

If x = -3 and y = 2, then |5x-2y|-|3x| = 10

Step-by-step explanation:

This is a problem that utilizes both substitution and the order of operations.

|5x-2y|-|3x| = \\|-15-(2)(2)|-|(3)(-3)| =\\ |-15-4|-|(3)(-3)| =\\|-19|-|(3)(-3)| =\\19-|(3)(-3)| =\\19-|-9| =\\19-9 =\\10


5 0
3 years ago
Read 2 more answers
Please help... i need it
Tanya [424]
Oh ok .so the answer is.....2838384764733 I suggest the method of comparing variables
8 0
3 years ago
Read 2 more answers
Three consecutive integers can be represented by the variable n, n+1 and n+2. If the sum of three consecutive integers is 57, wh
pashok25 [27]
You have some unknown integer n, and you know that adding this and the next two integers, n+1 and n+2, gives a total of 57.

This means

n+(n+1)+(n+2)=57

The task is to find all three unknown integers. Notice that if you know the value of n, then you pretty much know the value of the other three integers.

To find n, solve the equation above:

n+(n+1)+(n+2)=3n+3=57\implies 3n=54\implies n=\dfrac{54}3=18

So if 18 is the first integer, then others must be 19 and 20.
7 0
2 years ago
Read 2 more answers
Other questions:
  • The ratio of boys to girls is 40:56 what is the ratio in lowest terms
    6·1 answer
  • Quadrilateral ABCD is an Isosceles Trapezoid. Which angle is congruent to Angle C?
    8·2 answers
  • WILL GIVE BRAINLIST FOR CORRECT ANSWER PLEASE HELP ME ANSWER IS NOT 14 OR 19​
    10·1 answer
  • Solve for k.<br><br> 18 = 10 + 2k<br><br> k =
    13·1 answer
  • ASAP
    8·1 answer
  • #1: What is the x-intercept of the line graphed below? Write your answer as an ordered pair.​
    6·2 answers
  • PLEASE ANSWER ASAP!!!
    9·2 answers
  • 14. The measure of Fis 110. The measure of 2E is 100°<br> What is the measure of D?<br> 150°
    10·1 answer
  • Given the definitions of f(x) and g(x) below, find the value of f(g(2)).
    11·1 answer
  • Can someone look at the pic at tell me if Im doing this correctly? I got x=14 ty
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!