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
lesya [120]
3 years ago
7

Here is an array of ten integers 6 4 0 3 9 8 1 7 2 5

Mathematics
1 answer:
garik1379 [7]3 years ago
6 0

Answer:

[4,0,3,1,2,5] and [6,9,8,7]

Step-by-step explanation:

GIVEN:  an array of ten integers 6,4,0,3,9,8,1,7,2,5.

TO FIND: If we partition this array using Quick sort's partition function and using 5 for the pivot. List the elements of the resulting array after the partition finishes.

SOLUTION:

quick sort is a divide and conquer algorithm in which an array is partitioned into sub-arrays about an pivot element by checking whether elements are greater than pivot or and then sub arrays are sorted recursively.

Here 5 is the pivot element.

two arrays will be created, in first array element less than or equal to pivot element are stored in other elements greater than pivot element are stored.

Starting from first element of array

elements in first array will be =[4,0,3,1,2,5]

elements in second array will be =[6,9,8,7]

Hence the resulting array after the partition finishes are [4,0,3,1,2,5] and [6,9,8,7]

You might be interested in
Find (a) the slope of the curve at the given point P, and (b) an equation of the tangent line at P: y = 9x^2 + 5 ; P (2,41)
Flauer [41]

Answer:

(a) 36

(b) y = 36x-31

Step-by-step explanation:

(a) dy/dx = 18x

slope of tangent at (2, 41) = 18(2)

= 36

(b) using y-y1 = m(x-x1)

y-41 = 36(x-2)

y = 36x-31

6 0
3 years ago
Example 2:
Montano1993 [528]
Taking this example into account, we can see that setting the first value equal to 1, we obtain that F(x)=0.5x+1=4 and x=6. Using this information, we find that F(x+1)=0.5(x+1)+1=0.5(6+1)+1=4.5. It shows that when x is positive, the succussive terms are increasing.

Referring to that finding, if we set initial value less than zero, which means that we are solving 0.5x+1<0 and taking a number in the interval of the solution, which means x ∈ (- ∞, -20). Setting x=-19, we find that F(x)=0.5x+1=-19 and x=-40. In the next iteration, F(x+1)=0.5(x+1)+1=0.5(1-40)+1=-18.5. In the next iteration, F(x+2)=0.5(x+2)+1=0.5(2-40)+1=-18. By this way, we find that even if the initial value is less than zero, value of the successive iterations is increasing. 

Using the function g(x)=-x+2 and taking the initial value equal to 4, we find that g(x)=-x+2=4 and x=-2. In the next iteration, g(x+1)=-(x+1)+2=-(-2+1)+2=3. If we continue the iterations we'll see that they are decreasing.
Setting the initial value equal to 2, we find that g(x)=-x+2=2 and x=0. The next iteration is g(x+1)=-(x+1)+2=1. In this case, the interations are also decreasing. 
If we set the initial value equal to 1, we find that g(x)=-x+2=1 and x=1. In the next iteration, g(x+1)=-(x+1)+2=0 and the iterations are decreasing. 
8 0
3 years ago
A container holds 8 gallons of water. If 4/5 of a gallon is added to the container each hour, how many hours would it take to fi
son4ous [18]
1 hour = 4/5 gallon
8 gallon ÷ 4/5
= 8/1 × 5/4
= 40/4
= 10

the answer is A
3 0
3 years ago
Read 2 more answers
Find the coordinates of the image of point R(3, -5) rotated 180 degrees about the origin.
kolbaska11 [484]
180 degrees means that the new x=-x and the new y=-y so
x=3 and y=-5 is orignal
new is -3 and 5

so new oint is

A(-3,5)
6 0
3 years ago
Which powers are listed in order from least to greatest value?
lord [1]
I would go with B i had this question on my test and i got it correct 
6 0
2 years ago
Other questions:
  • What is y= -5/3 x - 1 graphed
    5·1 answer
  • Air has a density of 0.001226 g/mL. What volume of air would have a mass of 1.0 lb? A. 2.7 mL B. 815.6 mL C. 37 mL D. 3.7 × 102
    12·1 answer
  • [(3-^5)(3^4)]^3 I have no clue what to do here please help
    13·1 answer
  • Pls help me with this
    5·2 answers
  • Find the polynomial function
    7·1 answer
  • Expression equivalent to 2s + 3s^2
    12·1 answer
  • A few years ago, a survey commissioned by The World Almanac and Maturity News Service reported that 51% of the respondents did n
    8·1 answer
  • A sequence can be defined by the explicit formula an = 5 - 3n. which recursive formula represents the same sequence of numbers?
    14·2 answers
  • Detroit Windsor tunnel is an underwater highway that connects the cities in Detroit Michigan in Windsor Ontario. How many times
    13·2 answers
  • The theater has 9 chairs in a row and there are 4 rows there are 36 chairs and for an upcoming show, the theater needs to have 4
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!