Question

Q3. The number of operations executed by algorithms A and B are 12n3 + 40n log...

Q3. The number of operations executed by algorithms A and B are 12n3 + 40n log n and 5n4 -100n2 respectively.

Determine c and n0 such that B is greater than c*A for n ≥ n0.

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

12n B 5n-100 n2 Given Expressions A 40 n log n From the above expression, need to show that the number of operations executedn value is growing faster than the logn value. So, it can be written as in the below format log n<n log n 1 from the above st5n4-100 n2>12n3 40 n logn from the above expression, using induction method 1 then suppose 5(1)-100 (1)212(1) + 40 (1 logl) 55n4 -100 n2>12n3 40 n logn suppose n 7 then 5(7)4-100 (7)2>12(7) 40 (7 log7) 5(2401) 100(49) 12(343)+ 40 (5.9156 12005 4900 4

Add a comment
Know the answer?
Add Answer to:
Q3. The number of operations executed by algorithms A and B are 12n3 + 40n log...
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
  • Find the worst case runtime f(n) for the following algorithms. Specify the number of operations executed...

    Find the worst case runtime f(n) for the following algorithms. Specify the number of operations executed for an input size n, for the worst case run time as a function of n. Circle statement(s) and draw a   line to the right side specifying the number of operations. If statement(s) are a part of an iteration of n, specify the total number of iterations as a function of n. Algorithm-01 int sum = 0; int j = 1; while ( <=...

  • First, if the number equals Q3+1.5IQR, is it an outlier? Second, if the number is greater...

    First, if the number equals Q3+1.5IQR, is it an outlier? Second, if the number is greater than Q3+3IQR, is it an outlier? Third, how to determine an outlier by z-score? Should z-score bigger than 3 or 2?

  • STATEMENT 3: Algorithm A takes n log, (n) + 10na elementary operations and algorithm B takes...

    STATEMENT 3: Algorithm A takes n log, (n) + 10na elementary operations and algorithm B takes 1776 + n log, n. Then for large enough input algorithm A is faster than algorithm B. Statement 3 is (Select] STATEMENT 4: The running time of the following piece of code is nº log, (n)) k+1 fori + 1 to n do ifiis a power of 5 then while k <n do k elementary operations kk -- 1 Statement 4 is (Select]

  • PART B- The Efficiency of Algorithms, 10 points 1. Show how you count the number of...

    PART B- The Efficiency of Algorithms, 10 points 1. Show how you count the number of operations (not only . Consider the following two loops, 4 points: basic operations) required by the algorithm, 4 points: //Loop λ sumList (aList, n) ( thǐssum = 0; for (j = 1; j <= 10000; j++) sum - sum + j; lastSum = 5000; for (int i = 0; i <= n; i++) { // Loop B for (j = 1; j <= n;...

  • What does a run-time analysis usually countS pts a. The number of arithmetic and other operations...

    What does a run-time analysis usually countS pts a. The number of arithmetic and other operations required fot the b. The number of megabytes required for the program to run c. The number of seconds required for the program to run. d. The number of seconds plus the number of megabytes Total 100 points, 30 ins and other operations required for the program to rn 2. What do we call an input that results in the longest execution timet a....

  • Q5 Match the following operations to their corresponding worst case time complexities Operations Finding the nert larger item in a Hash Table Time Complexities од) O (log n) O(n) O(n log n) O(n2) o(n...

    Q5 Match the following operations to their corresponding worst case time complexities Operations Finding the nert larger item in a Hash Table Time Complexities од) O (log n) O(n) O(n log n) O(n2) o(n3) O(n + m) O(m logn) O((n +m) log n) O(n2+nm) Trying to remove a non-eristing item from a Hash Table 2 3Finding the previous smaller item in a possibly unbalanced BST Updating a previous value into a new value in an AVL Tree Sorting m edges...

  • Big O SECTION List appropriate Worst Case Big O Notation under the different algorithms or data...

    Big O SECTION List appropriate Worst Case Big O Notation under the different algorithms or data structure operations. Choose from right column and place under left column. Right column can be used more than once or not all. O(1) O(n) O(n ^ 2) O(log n) Time Efficiency A. dequeue() a Node 1,000,000 element Linked List - Queue Implementation B. Traversing a Doubly Linked List from the Tail Node to the Head Node C. Traversing every element in Stack with array...

  • Q3 [Number Searching] (25%) Given two non-negative integers A (data type: int) and B (data type:...

    Q3 [Number Searching] (25%) Given two non-negative integers A (data type: int) and B (data type: int), write a C++ program to determine whether A contains B, wherein "contains” means an exact match. For example, • If A is 12345 and B is 234, A contains B, where the matching part is underlined in A. • If A is 12345 and B is 235, A does not contain B, even A has the digits 2, 3 and 5. It is...

  • Algorithms and Basic Data Structures

    This part involves finding a new algorithm by yourself. You do NOT have to implement it with C++. You may just state the algorithm in pseudo-code. The problem is as follows: You have an integer array of n elements. You want to return true if there is a set of more than n/2 elements in the array with the same value, false otherwise. Notice that if the array is sorted (that is you are allowed to use a sorting algorithm),...

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