Question

128289 Computer Science

Q1. True or False? O(n) is called linear time 02. True or False? O(n*n) is called quadratic time 03. True or False? An algori

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

Ans 1: True

Ans 2: True

Ans 3: True

Ans 4: Garbage Value, as arr[5] means the value stored at index 6. Since the array arr is initialized to only 5 elements hence on printing arr[5] the value of 6th element will be printed which is by default garbage value.

Ans 5: 1,3logn,√nlogn, n, nlogn, n 2,2n , nn, n!

Add a comment
Know the answer?
Add Answer to:
128289 Computer Science Q1. True or False? O(n) is called linear time 02. True or False?...
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
  • Merge Sort: Time Complexity: O(n log(n)) #include "stdafx.h" #include <iostream> #include <time.h> #include <stdlib.h> using namespace...

    Merge Sort: Time Complexity: O(n log(n)) #include "stdafx.h" #include <iostream> #include <time.h> #include <stdlib.h> using namespace std; void combine(int *a, int low, int high, int mid) {        int i, j, k, c[100000];        i = low;        k = low;        j = mid + 1;        while (i <= mid && j <= high)        {               if (a[i] < a[j])               {                      c[k] = a[i];                      k++;                      i++;               }               else               {                     ...

  • THESE ARE TRUE/FALSE The best-time complexity for insertion sort is O(nlogn). The worst-time complexity for bubble...

    THESE ARE TRUE/FALSE The best-time complexity for insertion sort is O(nlogn). The worst-time complexity for bubble sort is O(nlogn). A linked structure consists of nodes. Each node is dynamically created to hold an element. All the nodes are linked together to form a list. The time complexity for searching an element in a binary search tree is O(logn) The time complexity for inserting an element into a binary search tree is O(logn). In an AVL tree, the element just inserted...

  • Please Help ASAP. 1Consider the below code which iterates over a linked list of n nodes...

    Please Help ASAP. 1Consider the below code which iterates over a linked list of n nodes (assume the list has at least 1 node). How many lines of output will it write? Node *thisNode = headPtr; while (thisNode != null) { cout << thisNode->item << endl; thisNode = thisNode->next; } 1.n 2.1 3.n2 4.n / 2 5.2 * n 2The below algorithm contains nested loops.   for (int total = 1; total <= n; total++) { for (int samples = 0;...

  • Analysis of Algorithms Fall 2013 Do any (4) out of the following (5) problems 1. Assume n-3t is a...

    Analysis of Algorithms Fall 2013 Do any (4) out of the following (5) problems 1. Assume n-3t is a power of 3 fork20. Solve accurately the following recursion. If you cannot find the exact solution, use the big-O notation. Tu) T(n)Tin/3)+2 2. Suppose that you have 2 differeut algorithms to solve a giveu probleen Algorithm A has worst-case time complexity e(n2) and Algorithm B has worst-case time complexity e(nlog n). Which of the following statements are true and which are...

  • This is an advanced version of the game tic tac toe, where the player has to...

    This is an advanced version of the game tic tac toe, where the player has to get five in a row to win. The board is a 30 x 20. Add three more functions that will check for a win vertically, diagonally, and backwards diagonally. Add an AI that will play against the player, with random moves. Bound check each move to make sure it is in the array. Use this starter code to complete the assignment in C++. Write...

  • 1. Give an asymptotically tight bound to each of the following expressions: 3n^2 + 2n^3 3n...

    1. Give an asymptotically tight bound to each of the following expressions: 3n^2 + 2n^3 3n log n + 2n^2 2^n + 3^n 2. Arrange the following asymptotic family from lower order to higher order. The first has been done for you. O(n log n) O(n^3) O(log n) O(n^2 log n) O(n) O(3^n) O(2^n) 3. At work, Peter needs to solve a problem of different sizes. He has two algorithms available to solve the problem. Algorithm A can solve the...

  • True or false? Question 6 1 pts Every prime number other than 2 can be expressed...

    True or false? Question 6 1 pts Every prime number other than 2 can be expressed in the form of 4k + 1 or 4k – 3 for some k E Z. True False Question 8 1 pts Suppose that algorithm A has running time na + 10 log2 (n) and the algorithm B has the running time n log2 (n) + 5n (where both depend on the input value n). Then for a sufficiently large input value n, algorithm...

  • Q1 Existence 5 Points Every square matrix has at least one eigenvalue. O True O False...

    Q1 Existence 5 Points Every square matrix has at least one eigenvalue. O True O False Save Answer Q2 Basis 5 Points Let A be an (n xn) matrix, and assume that A has n different eigenvalues, then there is a basis of R" consisting eigenvectors of A. O False O True Q3 Computation 5 Points [ 1 Find the algebraic and geometric multiplicity of the unique eigenvalue of 1 1 Write your answer in the form [a, g] where...

  • Q1. True / False Memoryless Causal Stable Time-invariant Linear y(t) = x(2t) – 1 rt-1 J-00...

    Q1. True / False Memoryless Causal Stable Time-invariant Linear y(t) = x(2t) – 1 rt-1 J-00 y(t) = Sx() dt y[n] = 2 x[m] m =0

  • Q1. Write a C++ class called Time24h that describes a time of the day in hours,...

    Q1. Write a C++ class called Time24h that describes a time of the day in hours, minutes, and seconds. It should contain the following methods: • Three overloaded constructors (one of which must include a seconds value). Each constructor should test that the values passed to the constructor are valid; otherwise, it should set the time to be midnight. A display() method to display the time in the format hh:mm:ss. (Note: the time can be displayed as 17:4:34, i.e. leading...

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