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
-3
votes
1 answer

Time Complexity Dijkstra

If complexity of algorithm is O(EVlogV). Given E=20000 and V=1000. How many seconds it will take to execute? 20000 * 10000 log 10000 = 800000000 what does 800000000 means ?
Amit Verma
  • 23
  • 4
-3
votes
1 answer

Efficiency in Imperative programming and Functional programming

I have a question about the performance of IP and FP. Let's say I have a function to compute nth Fibonacci number. In imperative programming I have a choice to computing the nth Fibonacci number using iterative way, recursion, or dynamic…
-4
votes
1 answer

Best-case running time: upper and lower bound?

In my assignment I was given some information about an algorithm in form of statements. One of these statements was: "the best-case running time of Algorithm B is Ω(n^2);". I was under the impression that best-case running time of algorithms is…
-4
votes
1 answer

Recursion tree for recursive equation

I have this recursive equation: T(n) = T(n/2) + T(n/5) + T(n/9) + Θ(n) I draw my recursion tree like this: cn / | \ n/2 n/5 n/9 / | \ / | \ / | \ .................. The tree has log(n) + 1 levels, each level…
PTN
  • 1,658
  • 5
  • 24
  • 54
-4
votes
2 answers

Is O(n^3) really more efficient than O(2^n)?

My algorithm class's homework claims that O(n3) is more efficient than O(2n). When I put these functions into a graphing calculator, f(x)=2x appears to be consistently more efficient for very large n (starting from around n = 982). Considering that…
coyote
  • 326
  • 2
  • 4
  • 11
-4
votes
1 answer

Do I have the right approach to finding the asymptotic complexity of the following Java functions?

Example1: This I would say is O(log(n)), my reasoning is that if we choose a test n, n = 10, then 'i' would run: 0,2,4,6,8,10, so 'i' is behaving linearly not growing but just adding + 2 each time it iterates. And the method is also 'n' - dependent…
yre
  • 285
  • 4
  • 12
-4
votes
2 answers

Big-Oh ascending order of some functions f(n)

Put these function in the ascending order of their growth in terms of n: 2^((log n)^0.5), 2^n, 2^(n/2), n^(4/3), n(log n)^3, n^(log n), 2^(n^2), n!
Ashish Jain
  • 447
  • 1
  • 6
  • 20
-4
votes
1 answer

Exponential BIG O notation?

I want to learn how to approach the following question: Which of the following function is larger by order of growth? (1/3)^n or 17? I have tried to find the answer, but I was unable to find a clear and straight forward explanation for how to…
user4278849
-4
votes
1 answer

Big-O Notation: What is the order of the algorithm?

I'm having trouble understanding Big-O Notation. Here is an algorithm I wrote, it is supposed to be an alternative of (C++) Stack's size() function, and I need to determine its running time with the assumption that there are n elements in the stack…
user11892
  • 103
  • 5
-4
votes
2 answers

What is the Big O, Theta O, Omega O for the following code?

for(i = 0; i < n; i++) { j+=i; } Assuming that Big O for the above code is O(2n), what will be Θ ( tight bound ) and Ω (lower bound) for the above code?
a3.14_Infinity
  • 5,653
  • 7
  • 42
  • 66
-4
votes
1 answer

What is the time-Complexity for the following code?

What is the time complexity for this code? In this code I am trying to solve the "Palindrome Partitioning" problem. I am using recursion. I am trying to understand DP. and through this program I want to analyse it's time complexity. I want to…
-5
votes
1 answer

Finding Worst Case complexity of the function 4n log n+7n

I am having a hard time trying to solve this one particular Big Oh problem: 4n log n+7n=O(n log n) I have tried by applying n>=1, but nothing's coming out of it and the only hint is that 4n log n dominates 7n.
-5
votes
1 answer

best case and worst case in next permutation algorithm

Can someone explain why the in next permutation algorithm, we have O(n) as worst case and O(1) as best case? An explanation with an example would be appreciated... The algorithm is: Find the largest index k such that a[k] < a[k + 1]. If no such…
mskeira
  • 25
  • 1
  • 5
-5
votes
2 answers
-8
votes
1 answer

Asymptotic Estimate for integer division

k = n; //integer division while(k > 1) { std::cout << k; k=k/2; } I need to find out the asymptotic estimate as a function of n.
1 2 3
53
54