what is runing time of Algo1 in Θ-notation?
1.The running time of an algorithm is the number of instructions it executes in the RAM(Random access memory) model of computation.
2.Θ-notation is used to give asymptotically tight bounds.Since, it represents the upper and the lower bound of the running time of an algorithm,it is used for analyzing the average case complexity of an algorithm.
Let's take a simple implementation of linear search to understand better.
1. int linearSearch(const vector<int>& array,
2. const int targetValue) {
3.for (int guess = 0; guess < array.size(); guess++) {
4.if (array[guess] == targetValue) {
5.return guess;
6.}
7.} return -1;
8.}
Let's denote the size of the array by n. The maximum number of times that the for-loop can run is n, and this worst case occurs when the value being searched for is not present in the array. Each time the for-loop iterates, it has to do several things: compare guess with n; compare array[guess] with targetValue; possibly return the value of guess; and increment guess. Each of these little computations takes a constant amount of time each time it executes. If the for-loop iterates n times, then the time for all n iterations is c1⋅n, where c1 is the sum of the times for the computations in one loop iteration. Now, we cannot say here what the value of c1 is, because it depends on the speed of the computer, the programming language used, the compiler or interpreter that translates the source program into runnable code, and other factors. This code has a little bit of extra overhead, for setting up the for-loop (including initializing guess to 0) and possibly returning -1 at the end. Let's call the time for this overhead c2, which is also a constant. Therefore, the total time for linear search in the worst case is c1⋅n + c2.
As we've argued, the constant factor c1 and the low-order term c2 don't tell us about the rate of growth of the running time. What's significant is that the worst-case running time of linear search grows like the array size n.
The notation we use for this running time is Θ(n) or Theta notation.
When we say that a particular running time is Θ(n), we're saying that once n gets large enough, the running time is at least k1⋅n and at most k2⋅n for some constants k1 and k2. Here's how to think of Θ(n):

For small values of n, we don't care how the running time compares with k1⋅n or k2⋅n. But once n gets large enough—on or to the right of the dashed line—the running time must be sandwiched between k1⋅n and k2⋅n. As long as these constants k1 and k2 exist, we say that the running time is Θ(n).

Once n gets large enough, the running time is between k1⋅f(n) and k2⋅f(n).
In practice, we just drop constant factors and low-order terms. Another advantage of using big-Θ notation is that we don't have to worry about which time units we're using. For example, suppose that you calculate that a running time is 6n2 + 100n + 3006 microseconds. Or maybe it's milliseconds. When you use big-Θ notation, you don't say. You also drop the factor 6 and the low-order terms 100n + 300, and you just say that the running time is Θ(n2).
Give the best-case and worst-case running time of SELECTION SORT in Θ notation, in details and with explanation
In Big-Θ notation, analyze the running time of the following pieces of code/pseudo-code. Describe the running time as a function of the input size (here, n) for(int i=n-1; i >=0; i--){ for(int k=0; k < i*n; k++){ // do something that takes O(1) time } }
for all>, Show, using this definition of Θ notation, that if f(x)an-1... +ai +ao that f is Θ(z")
for all>, Show, using this definition of Θ notation, that if f(x)an-1... +ai +ao that f is Θ(z")
In Big-Θ notation, analyze the running time of the following pieces of code/pseudo-code. Describe the running time as a function of the input size (here, n) int *a = new int [10]; // new is O(1) int size = 10; for (int i = 0; i < n; i ++) { if (i == size) { int newsize = 3*size/2; int *b = new int [newsize]; // new is O(1) for (int j = 0; j < size; j ++)...
What is the time complexity of T(n) = cn^2 + T(n/4) + T(n/8) in θ ? What is the time complexity of T(n) = cn^2 + (1/4)T(n/4) + (3/4)T(n/8) in θ?
Here are some common orders of growth, ranked from no growth to
fastest growth:
Θ(1) — constant time takes the same amount of time regardless
of input size
Θ(log n) — logarithmic time
Θ(n) — linear time
Θ(n log n) — linearithmic time
Θ(n2 ) — quadratic time
Θ(n3 ), etc. — polynomial time
Θ(2n), Θ(3n), etc. — exponential time
(considered “intractable”; these are really, really horrible)
In addition, some programs will never terminate if they get
stuck in an...
2. Asymptotic Notation (8 points) Show the following using the definitions of O, Ω, and Θ. (1) (2 points) 2n 3 + n 2 + 4 ∈ Θ(n 3 ) (2) (2 points) 3n 4 − 9n 2 + 4n ∈ Θ(n 4 ) (Hint: careful with the negative number) (3) (4 points) Suppose f(n) ∈ O(g1(n)) and f(n) ∈ O(g2(n)). Which of the following are true? Justify your answers using the definition of O. Give a counter example if...
1
Write a program to convert the time from 24-hour notation to
12-hour notation and vice versa. Your program must be menu driven,
giving the user the choice of converting the time between the two
notations. Furthermore, your program must contain at least the
following functions:
a function to convert the time from 24-hour notation
to 12-hour notation,
a function to convert the time from 12-hour notation
to 24-hour notation,
a function to display the choices, function(s) to get
the...
Implement the maximum-subarray problem using brute-force approach taking Θ(n2)Θ(n2) time.
23. What values for θ(0 2π) satisfy the equation? θ 2 sin θ cos θ + cos θ 0