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
katrin2010 [14]
3 years ago
15

divide the input array into thirds (rather than halves), recursively sort each third, and finally combine the results using a th

ree-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:
Digiron [165]3 years ago
4 0

Answer:

The answer is "nlogn".

Explanation:

  • The time complexity can only shift to 3 with the last instance.  For the 2nd case, they need one parallel. However, 2 parallels are needed to sort with splitting into 3-way frames.
  • It decreases the number of passes even after breaking the collection in 3 by increasing contrast. So, the time complexity remains the same but the log is divided into 3 bits.  
  • The complexity of time is:   T(n)=3T(\frac{n}{3})+ O(n) =  O(nlogn)_3.
You might be interested in
Write a program to implement problem statement below; provide the menu for input N and number of experiment M to calculate avera
zalisa [80]

Answer:

Explanation:

#include<iostream>

#include<ctime>

#include<bits/stdc++.h>

using namespace std;

double calculate(double arr[], int l)

{

double avg=0.0;

int x;

for(x=0;x<l;x++)

{

avg+=arr[x];

}

avg/=l;

return avg;

}

int biggest(int arr[], int n)

{

int x,idx,big=-1;

for(x=0;x<n;x++)

{

if(arr[x]>big)

{

big=arr[x];

idx=x;

}

}

return idx;

}

int main()

{

vector<pair<int,double> >result;

cout<<"Enter 1 for iteration\nEnter 2 for exit\n";

int choice;

cin>>choice;

while(choice!=2)

{

int n,m;

cout<<"Enter N"<<endl;

cin>>n;

cout<<"Enter M"<<endl;

cin>>m;

int c=m;

double running_time[c];

while(c>0)

{

int arr[n];

int x;

for(x=0;x<n;x++)

{

arr[x] = rand();

}

clock_t start = clock();

int pos = biggest(arr,n);

clock_t t_end = clock();

c--;

running_time[c] = 1000.0*(t_end-start)/CLOCKS_PER_SEC;

}

double avg_running_time = calculate(running_time,m);

result.push_back(make_pair(n,avg_running_time));

cout<<"Enter 1 for iteration\nEnter 2 for exit\n";

cin>>choice;

}

for(int x=0;x<result.size();x++)

{

cout<<result[x].first<<" "<<result[x].second<<endl;

}

}

8 0
3 years ago
What is BINARY it is making get confused
enot [183]
It is a number that is expressed in the binary numerical system
6 0
3 years ago
1. A truck leaves a stop sign and accelerates uniformly over a time of 5.21 seconds for a
Rufina [12.5K]

Answer:

1, is 21.11 meters per second.

110/5.21

Explanation:

3 0
3 years ago
A brown outline around a frame is an indication of which tool?​
zimovet [89]

Answer:

Direct Selection Tool

Explanation:

The Direct Selection tool is a tool that allows the selection of a single object or a single path such that an object already grouped with other objects can be directly and moved to a desired location

The Direct Selection tool can be used to select a container's content including graphics which are imported and specific points or paths of a figure or text to allow for drawing, text editing or to edit paths.

6 0
3 years ago
What is a primary feature of a digital video camera?
masha68 [24]
The primary feature of a digital video camera is to records video as digital signals. A digital video camera picture out as of live settings, encrypting it into information that can be definite or transcoded into electronic photographic media. A typical digital camera contains of a lens, image sensor, storing media and a number of other characteristics that can be also be initiated on other cameras such as scalable aperture, filters and flash. High feature images and digital video slides can be put in storage and replicated on a computer, CD or writable DVD or on the internet in deprived of any loss of quality.
4 0
3 years ago
Other questions:
  • That is Entrepreneur ? ?<br>​
    8·1 answer
  • Write a program that produces a Caesar cipher of a given message string. A Caesar cipher is formed by rotating each letter of a
    14·1 answer
  • As defined by the National Institute of Standards and Technology​ (NIST), "________ is a model for enabling​ ubiquitous, conveni
    11·1 answer
  • How do i find the greatest common factor of two numbers?
    14·1 answer
  • One condition for deadlocks is the circular-wait condition. One way to ensure that this condition never holds is to impose a tot
    12·2 answers
  • Which person would be the best fit for a career in the Information Technology field?
    6·2 answers
  • 22. Which of the following device will you require to hear music on
    5·1 answer
  • 9.19 LAB: Words in a range (lists) Write a program that first reads in the name of an input file, followed by two strings repres
    6·1 answer
  • Gary says, "Ports are where data enter a network before reaching a gateway. The data travel via transmission
    10·1 answer
  • An e-commerce client is moving from on-premise, legacy systems to a cloud-based platform. During the transition, the client is a
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!