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
anzhelika [568]
3 years ago
10

Suppose we use radix sort to sort the English-language strings below using standard lexicographic ordering (i.e. sort in alphabe

tical order). We sort least-to-greatest and consider the numbers in top-to-bottom order when assigning them to bins. Assume the empty string" comes before all letters in lexicographic order. PART TRIP
TARP
ART
TRAP
CHIP

a) (1 point) How many passes are required to sort the strings?
b) (1 point) How many buckets would radix sort allocate to sort the strings?
c) (5 points) For each of the following pairs of words, fill in the circle next to the word that would appear earlier in the list after two passes of radix sort.
i) TRIP or TARP
CHIP or TRIP
iii) ART or PART
iv) PART or TARP
v) TARP or TRAP

d) State the runtime of radix sort on each of the following inputs set as precisely as you can. Include any known constant factors. i) (1 pt) Runtime on English-language strings of length d: ii) (1 pt) Runtime on decimal integers of length d:

Engineering
1 answer:
nlexa [21]3 years ago
7 0

Answer:

a) 4 passes are required to sort the string.

b) 4

c)   i) TARP

    ii) CHIP

    iii) PART

    iv) TARP

    v) TARP

d) O(k+n), n is no. of strings, k is largest no. of character in among the string

   O(d*(n+10)), n is no. of integers

Explanation:

You might be interested in
A civil engineer is studying a left-turn lane that is long enough to hold seven cars. Let X be the number of cars in the line at
BartSMP [9]

Answer:

a) C= 1/120

b) P(X>=5) = 0.333

Explanation:

The attached file contains the explanation for the answers

7 0
3 years ago
Read 2 more answers
The velocity profile for a thin film of a Newtonian fluid that is confined between the plate and a fixed surface is defined by u
zimovet [89]

Answer:

F = 0.0022N

Explanation:

Given:

Surface area (A) = 4,000mm² = 0.004m²

Viscosity = µ = 0.55 N.s/m²

u = (5y-0.5y²) mm/s

Assume y = 4

Computation:

F/A = µ(du/dy)

F = µA(du/dy)

F = µA[(d/dy)(5y-0.5y²)]

F = (0.55)(0.004)[(5-1(4))]

F = 0.0022N

8 0
3 years ago
To increase the thermal efficiency of a reversible power cycle operating between thermal reservoirs at TH and Tc, would you incr
alukav5142 [94]

<u></u>\ T_{c} has greater effect.

<u>Explanation</u>:

\eta_{\max }=1-\frac{T_{c}}{T_{A}}

T_{c}\\ = Temperature of cold reservoir

T_{H} = Temperature of hot reservoir

when T_{c} is decreased by 't',

$\eta_{\text {incre }}$ = 1-\frac{\left(\tau_{c}-t\right)}{T_{H}}

=n \ + \frac{t}{T_{n}}      -(i)

when {T_{H}} is increased by 'T'

\eta_{i n c}=\frac{n+\frac{t}{T_{H}}}{\left(1+\frac{k}{T_{H}}\right)}-(ii)

\eta_{\text {incre }} \ T_{c}>\eta_{\text {incre }} T_{\text {H }}

7 0
3 years ago
Write a iterative function that finds the n-th integer of the Fibonacci sequence. Then build a minimal program (main function) t
Natasha2012 [34]

Answer:

Codes for each of the problems are explained below

Explanation:

PROBLEM 1 IN C++:

#include<iostream>

using namespace std;

//fib function that calculate nth integer of the fibonacci sequence.

void fib(int n){

  // l and r inital fibonacci values for n=1 and n=2;

  int l=1,r=1,c;

 

  //if n==1 or n==2 then print 1.

  if(n==1 || n==2){

      cout << 1;

      return;

  }

  //for loop runs n-2 times and calculates nth integer of fibonacci sequence.

  for(int i=0;i<n-2;i++){

      c=l+r;

      l=r;

      r=c;

      cout << "(" << i << "," << c << ") ";

  }

  //prints nth integer of the fibonacci sequence stored in c.

  cout << "\n" << c;

}

int main(){

  int n; //declared variable n

  cin >> n; //inputs n to find nth integer of the fibonacci sequence.

  fib(n);//calls function fib to calculate and print fibonacci number.

}

PROBLEM 2 IN PYTHON:

def fib(n):

   print("fib({})".format(n), end=' ')

   if n <= 1:

       return n

   else:

       return fib(n - 1) + fib(n - 2)

if __name__ == '__main__':

   n = int(input())

   result = fib(n)

   print()

   print(result)

7 0
3 years ago
Read 2 more answers
You were hoping to receive a scholarship for volleyball and are entering your personal information and statistics on a secure we
kozerog [31]
I think it is fair to say 5 and 3/4 inches.
6 0
3 years ago
Read 2 more answers
Other questions:
  • A tendon-operated robotic hand can be implemented using a pneumatic actuator. The actuator can be represented by
    15·1 answer
  • Let suppose, you are going to develop a web-application for school management system. Then what architectural pattern will you u
    9·1 answer
  • What happens to a commercial airline at cruising altitude if the pilot does not touch the throttles?
    12·1 answer
  • Write a program that prompts the user to enter two characters and display the corresponding major and year status. The first cha
    7·1 answer
  • A hollow aluminum sphere, with an electrical heater in the center, is used in tests to determine the thermal conductivity of ins
    6·1 answer
  • Design a digital integrator using the impulse invariance method. Find and give a rough sketch of the amplitude response, and com
    15·1 answer
  • What should you consider when choosing the type of hearing protection you use?
    15·1 answer
  • Two sites are being considered for wind power generation. On the first site, the wind blows steadily at 7 m/s for 3000 hours per
    5·1 answer
  • REVVIVE ME MY MOM WALKED IN MY ROOM AND SCARED THE BAJESUS OUTTA ME
    5·2 answers
  • 1. What did observations between 1912 and 1917 show?_____
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!