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.




Q3. The number of operations executed by algorithms A and B are 12n3 + 40n log...
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 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 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 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 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(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 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: 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...
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),...