Question

A certain computer algorithm executes three times as many operations when it is run with an input of size n as when it is run

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1. Given, a certain computer algorithm executes three times as many operations when it is run with an input of size n as when it is run with an input of size n-1.

When the algorithm is run with an input of size 1 , it executes 10 operations.

Now we have to find the number of operations the algorithm executes when it is run on an input of size n.

sn = 10 × 3(n-1)

Here, sn = number of operations the algorithm executes

n = input size

Add a comment
Know the answer?
Add Answer to:
A certain computer algorithm executes three times as many operations when it is run with an input...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 1·2 points Find the first six terms of the following recursively defined sequence: tk(k-1)tk-1 +2...

    1·2 points Find the first six terms of the following recursively defined sequence: tk(k-1)tk-1 +2tk-2 for k 2 2 1.t1. 2. [3 points] Consider a sequence co, c, C2, . . . defined recursively ck = 3Q-1 + 1 for all k 2 1 and co 2. Use iteration to guess an explicit formula for the sequence 3. [3 points] Use mathematical induction to verify the correctness of the formula you obtained in Problem 2 4. [2 points] A certain...

  • Suppose that an algorithm has run-time proportional to 2n , where n is the input size....

    Suppose that an algorithm has run-time proportional to 2n , where n is the input size. The algorithm takes 1 millisecond to process an array of size 10. How many milliseconds would you expect the algorithm take to process an array of size 20 ?

  • Problem 1: Let W(n) be the number of times "whatsup" is printed by Algorithm WHATSUP (see below) ...

    Problem 1: Let W(n) be the number of times "whatsup" is printed by Algorithm WHATSUP (see below) on input n. Determine the asymptotic value of W(n). Algorithm WHATSUP (n: integer) fori1 to 2n do for j 1 to (i+1)2 do print("whatsup") Your solution must consist of the following steps: (a) First express W(n) using summation notation Σ (b) Next, give a closed-form formula for W(n). (A "closed-form formula" should be a simple arithmetio expression without any summation symbols.) (c) Finally,...

  • A program with a quadratic run time takes t seconds to run, when given an input...

    A program with a quadratic run time takes t seconds to run, when given an input size n. If the same algorithm is given input of size 2n, then the program will take approximately how many seconds? a. 2t b. t c. 4t d. 6t

  • You are given an algorithm that uses T(n) a n2b.3" basic operations to solve a problem...

    You are given an algorithm that uses T(n) a n2b.3" basic operations to solve a problem of size n, where a and b are some real non-negative constants. Suppose that your machine can perform 400,000,000 basic operations per second (a) If a = b = 1, how long does it take for your algorithm to solve problems of size n = 10, 20, 50. For each size of n, include the time in seconds and also using a more appropriate...

  • Here is a recursive algorithm that answers the same question as posed on Group HW3, finding...

    Here is a recursive algorithm that answers the same question as posed on Group HW3, finding the number of people who are taller than everyone before them in line. NumCanSeeRec(a1,... , an : list of n 2 1 distinct heights) (a) ifn -1 then (b return 1 (c) c= ŅumCanSeeRee(a1, , an-1) d) for i:- 1 ton- 1 (e) if a, an then return c (g) return c+1 Answer the following questions about this algorithm. Please show your work. (a)...

  • 9. (5 points) Please describe an algorithm that takes as input a list of n integers...

    9. (5 points) Please describe an algorithm that takes as input a list of n integers and finds the number of negative integers in the list. 10. (5 points) Please devise an algorithm that finds all modes. (Recall that a list of integers is nondecreasing if each term of the list is at least as large as the preceding term.) 11. (5 points) Please find the least integer n such that f() is 0(3") for each of these functions f()...

  • Determine the output of each algorithm below the number of assignment operations in each (show work)...

    Determine the output of each algorithm below the number of assignment operations in each (show work) the number of print operations in each (show work) the complexity of each algorithm in terms of Big O notation (show work) 2. Let n be a given positive integer, and let myList be a three-dimensional array with capacity n for each dimension. for each index i from 1 to n do { for each index j from 1 to n/2 do { for...

  • help in design of algorithm answers with steps for study guide (2 points) Why shouldn't we...

    help in design of algorithm answers with steps for study guide (2 points) Why shouldn't we measure time efficiency based on the number of seconds or milliseconds it takes the algorithm 1. to run? is the number of times the most important operation of the (2 points) The 2. algorithm occ Ccurs (3 points) Find the binary representation of the following numbers: 3. BINARY REPRESENTATION (in bits) NUMBER 777 14 684,739 4. (8 points) Write the input size metric and...

  • 4.     Find a closed form, in terms of n, for the number of times S is...

    4.     Find a closed form, in terms of n, for the number of times S is executed in the following algorithm: for i := 1 to n do for j := i to n do S od od  

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT