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
harina [27]
3 years ago
13

Consider the following modification to the Merge Sort algorithm: divide the input array into thirds (rather than halves), recurs

ively sort each third, and finally combine the results using a three-way Merge subroutine. What is the running time of this algorithm as a function of the length n of the input array, ignoring constant factors and lower-order terms
Computers and Technology
1 answer:
ehidna [41]3 years ago
7 0

Answer:

The correct answer to the following question will be "n logn".

Explanation:

  • Time Complexity should be the same as the whole last particular instance, just the log base keeps changing with three.  
  • Throughout the circumstance of separating 2 arrays, we want one correlation. however, for splitting between 3-way arrays, will require 2 comparisons to sort.
  • However, after breaking the array into 3, we can lower the number of transfers by growing the comparison. So the time complexity would then persist the same, but the log should get base 3 as we've classified into different parts.

So the time complexity will be:

⇒  T(n)=3T(\frac{n}{3})+ O(n)

⇒          =O(n \ logn) \ with \ base \ 3

You might be interested in
What is 2D thinking and 3D thinking? i literally don't understand
andriy [413]

Answer:

Two dimensional thinking implies concepts that are flat or only partially representative of the whole. Three dimensional thinking implies the first part of 2d thinking conjoined with intersecting dimensions rendering a deeper field of meaning.

Explanation:

8 0
3 years ago
Play among us with me
omeli [17]

Answer:

cool

Explanation:oof

8 0
3 years ago
Read 2 more answers
Write a filter that reads in a sequence of integers and prints the integers, removing repeated values that appear consecutively.
lara31 [8.8K]

Answer:

Following is the code for filter:

public class filter

{ public static void main(String[] args)

{ int x = StdIn.readInt();

System.out.print(" " + x + " ");

while(!StdIn.isEmpty())

{ int y = StdIn.readInt();

    if(y != x)

          System.out.print(" " + y + " ");

    x = y;

    }

    }

    }

Explanation:

  • A public class filter is used.
  • The main function will accept a single argument as string[], it is also known as java command line argument.
  • Now the Stdln.readInt is used to read the integers in the sequence and store it in integer x.
  • The value stored in variable x will be printed using System.out.print
  • Now unless the Stdln.readInt gets an empty value, check each value of sequence and store in variable y.
  • If y is not equal to previous value x, print it and shift the value of y into x.
  • Repeat the loop again.

i hope it will help you!

7 0
3 years ago
Read 2 more answers
When Windows deletes the driver package and driver files, in what situation might it not delete driver files used by the device
musickatia [10]

Answer:

when there is no junk

Explanation:

3 0
3 years ago
What is the definition of "potential energy"?
muminat
Well potential energy is energy that is in a object while its not moving so i would go your third option 
4 0
3 years ago
Read 2 more answers
Other questions:
  • Trading your bicycle for a snowboard exemplifies ?
    15·1 answer
  • The work principle is not always true<br> T or F
    11·2 answers
  • Markaplier nand jackceptieye are the best YT ever who agrees
    5·2 answers
  • How do I make my own extension for chrome?
    7·1 answer
  • Who would use a CLI? (Command Line Interface)
    9·1 answer
  • AWT
    7·1 answer
  • Please help ASAP!
    7·2 answers
  • Class 10 computer unit 1 all excersise​
    12·1 answer
  • What is causing the electricity prices to increase in South Africa?​
    14·1 answer
  • What is Utility Software ? Name any two utility programs. <br>​
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!