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.
If we have an algorithm which is order N^2*logN, and if it takes 1 ms with input size 64; does it take 2^10*(11/6) ms to run this algorithm with input size 2048? I am using direct proportion here, that's why it seemed defective to me.
Easiest way to solve is probably to divide 2048 by 64, plug the resulting number into the complexity equation, and the result is the number of milliseconds for Input size 2048.
Related
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 really need an advice. I have a function that have big number of recursive calls. Actually i need it. And algorithm is correct it works in C but in lisp there is a problem because of stack overflow. What should i do to solve it? How can i change algorithm to be able to work in lisp?
You have three options:
Rewrite the algorithm to be tail-recursive or, equivalently, iterative
Change the algorithm all together
Increase the lisp's stack size
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.
A sampling algorithm could output any real number in range [0,1],but the correct answer is in the range [0.1,0.2+x]("x" is in range [0,1]), the algorithm can output a correct answer with probability more than "0.8", then how to give a good answer with high probability? (such as run it many times, and pick the median as the right answer)
I think the question may be asking about the central limit theorem. If the samplings are independent and identically distributed, the OP could apply the classical form: Classical CLT
Otherwise, I recommend viewing the rest of the Wikepedia article to see if any of the other forms are applicable.
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.
You have a continuous stream of numbers coming in. You don't have space to store them all. But devise a mechanism by which at any point of time you select any number with equal probability.
Have space for one number, and for the nth number replace it with that number with probability 1/n.
http://en.wikipedia.org/wiki/Reservoir_sampling
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.
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 12 years ago.
How to calculate the Complexity of the Stack?
Yes, I mean the various operations of Stack (Push, Pop). How it can be said that the complexity for these operations will be O(1).
Pop Θ(1)
Push Θ(1)
Because this operations not depends on size of stack and not depends on nothing.