Questions tagged [asymptotic-complexity]

Asymptotic complexity is an approximation of the edge case performance of an algorithm used to determine best and worst case scenarios.

796 questions
-1
votes
1 answer

How can I give T(n) in asymptotic notation for recursions?

I need to give T(n) in asymptotic notation for the following recursions: T(n) = 2T(n/2) + *big_omega(n) T(n) = T(n-1) + *big_omega(n) And possibly explain the reasoning? Thanks
HJGBAUM
  • 297
  • 5
  • 16
-1
votes
1 answer

Unable to understand execution time in an algorithm

I have difficulty determining the execution time of each step in an algorithm. I just can't understand the logic. We all know prior to determining the Big O or Theta in an algorithm, we have to calculate the execution time of each step, then we…
napi15
  • 2,354
  • 2
  • 31
  • 55
-1
votes
1 answer

Determining the running time for recurrence relation T(n) = T(n-1)+n

How do I determine the running time (in terms of Big-Theta) for the algorithm of input size n that satisfies recurrence relation T(n) = T(n-1)+n where n >= 1 and with initial condition T(1) = 1? Edit: I was practicing a past exam paper. Got stuck on…
Eninfo
  • 217
  • 1
  • 2
  • 11
-1
votes
1 answer

Comparing two asymptotic growth rate of two functions

I have a hard time comparing the two functions: n^(0.001n) n! Any insights?
Shane Hsu
  • 7,937
  • 6
  • 39
  • 63
-1
votes
1 answer

How to calculate Best case time complexity

How does one go about finding the best case time complexities for formulae like 2n², 3⋅log₂(n) and 2n² + 10n? What is the exact procedure?
jimo
  • 430
  • 2
  • 7
  • 19
-1
votes
1 answer

Homework: Prove or disprove: (5n)!=O(n!^5)

I have this question in my h.w: Prove or disprove: (5n)!=O(n!^5). I don't know how to approach this (of course I know the O notation definition but I don't have a clue how to solve it).. any help please?
CnR
  • 351
  • 1
  • 6
  • 15
-1
votes
1 answer

Asymptotic analysis of functions

I have the following function to prove that its time complexity is less or equal to O(xlogx) f(x) =xlogx+3logx2 I need some help to solve this.
-1
votes
1 answer

Asymptotic analysis - order functions

Can you please help to answer the following question: Arrange the following functions in increasing order of growth rate (with g(n) following f(n) in your list if and only if f(n)=O(g(n))). sqr(n) 10^n n^1.5 2^sqr(log(n)) n^5/3 I used…
Nada Ghanem
  • 451
  • 6
  • 16
-1
votes
1 answer

unable to correctly calculate time complexity of delete operation in an array?

Code snippet Following is the delete function definition to delete all the occurrences of an element x in an int type array named a in C language! void delete(int x) { for(int i=0 ; i
varunsinghal65
  • 536
  • 1
  • 5
  • 20
-1
votes
1 answer

Big Theta asymptotic analysis

Given that f(n) ∈ Ѳ(g(n)); how can you prove that 2^(f(n)) ∈ Ѳ(2^(g(n)))? I have tried using limits of big theta and using first principles, no luck. Please help
-1
votes
1 answer

How do I find the time complexity of these 3 nested loops?

The task is to analyze the following algorithm and calculate its time complexity. I solved it as taking nested loops are 3 so O(n^3). How do I solve this problem? MSS (A[], N) //Where N is size of array A[] { int temp = 0, MS =…
-1
votes
1 answer

Javascript Can't compute the result?

Below is my script var num=1; var validator =false; while(!validator){ for(var k=1;k<=N;k++) { if(num%k==0) { validator = true; } else { validator = false; break; } } num =…
subh
  • 327
  • 1
  • 3
  • 6
-1
votes
3 answers

Is an algorithm with asymptotic runtime complexity of θ(n) always faster runtime than a similar algorithm with runtime complexity of θ(n^2 )?

If so can you provide explicit examples? I understand that an algorithm like Quicksort can have O(n log n) expected running time, but O(n^2) in the worse case. I presume that if the same principle of expected/worst case applies to theta, then the…
Ian R
  • 1
  • 1
  • 1
-1
votes
1 answer

Prove max(O(f(n)), O(g(n)))=O(max(f(n), g(n))

Prove max(O(f(n)), O(g(n)))=O(max(f(n), g(n)) It does make sense, but so far I don't have any idea how to actually prove it. Any input would be appreciated.
EatEmAll
  • 87
  • 11
-1
votes
1 answer

Coin change but with only 1 of each denomination of coin

The problem is: The algorithm I came up with is something like: pair[n][A] memo; // memo[i][j].first will be true if its possible to // use up to i-th denomination for amt j // memo[i][j].second will contain info on which //…
Jiew Meng
  • 84,767
  • 185
  • 495
  • 805