Why big O for this equation is n cube? [closed] - data-structures

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I have this question about why the big O for this equation is n cube ?
else if(key == 'x')
C = matrixMult(A, B);
Thanks very much

The resulting matrix has n^2 entries. The computation of each entry can be done by a sum of n products, yielding n^3.
This is only valid for the textbook algorithm, as there exist faster algorithms, e.g. Strassen's algorithm or the fastest known algorithm.

Related

Giving the Big O, Big Theta and Big Omega for a function [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
How can one give Big O, Big Theta or Big Omega for a function like
T(n) = n + 10*log n
Can someone please tell me how I can get the complexity for such a thing?
Drop all lower-order terms and constants and you get:
Θ(T(n)) = Θ(n + 10*log(n)) = Θ(n)
Since this is a tight bound (Θ) we also infer upper and lower bounds as O(n) and Ω(n).

CUDA dijkstra's algorithm [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
Has anybody implemented a CUDA parallelization version of Dijkstra's Algorithm for a given sparse matrix (cuSPARSE) graph, and for source, and target node, find the minimal K path?
I really need it to solve a general graph I'll be constructing.
Vincent

Order (Slowest to Fastest) Big O running times [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
Assuming that N is very large, can anybody help me in ordering the following list for Big O running times from Slowest to Fastest.
O(N^2)
O(N)
O(1)
O(N!)
O(2^N)
O(N log N)
O(N^3)
O(log N)
Divide O(A/B) to see if O(A) is asymptotically larger than O(B). (Take the limit as n->infinity. For example N^2/N = N, which blows up to infinity, so N^2>N asymptotically. Alternately, N/N^2 = 1/N which approaches 0, so N
Then you can graph them to check your work and get intuition (though graphs like this can easily "lie" if you graph them too close to the origin, and/or there are smaller hidden terms).

Brainstorm: To compute x/y in log(n) time, [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
How will you compute x/y in O(log(n)) time.
n=x/y, x & y are integers
You can't use the / operator.
One implementation is to add y q times till the result is less than x i.e.
y * q < x
What about 10**(log(x) - log(y))
Big O() notation only applies to how a problem scales with different number of inputs.
The question doesn't make sense unless you mean 'n' is the number of digits in x and y

Sum Algorithm: O(n^2) in average [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I have n numbers (could be a list or array of n numbers).
Given a number k I want to return a quadruplet of numbers (a,b,c,d) thus that
a+b+c+d=k.
Time Complexity: O(n^2) in average (probability).
You might find this useful: http://en.wikipedia.org/wiki/Dynamic_programming
Think about how to break the problem into subproblems.

Resources