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.
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 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
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'm studying computability theory, and I'm looking for a problem that clearly can be solved, but not in polynomial time.
I tried thinking of all sort's of examples, but it wasn't clear why they can't be solved in polynomial time..
The travelling sales man problem.
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 9 years ago.
how can I build a balanced quad tree.
Thanks, Marcos
Balancing is traditionaly a part of "k-D Tree" algorithm, which is superset for octrees. Try e.g. wikipedia page on this algorithm.