complexity

Where has this cluster search algorithm been presented before?

See: http://kks.cabal.fi/GoodEnoughSearch I have gone through quite many papers and sites. I have not found where this algorithm has been presented before, or that someone has made something similar, but better or more general. The algorithm is pretty simple and thus should be found quite easily by anyone facing the same kind of problem...

Please help to compare algorithm complexity

Hello, Please, help me to compare complexity of two algorithms. O(N+1000) + O(M*log(M)) O(N*5) + O(2000) N = 100000 M = 100 I can't understand, what should I do with O(...)? Can I leave it? And just do... (N+1000) + (M*log(M)) = 101200 (N*5) + 2000 = 502000 Is it right? Thank you UPDATED I have task and I have two probable so...

P != NP question

Not a 'pure' programming question, but since it is deeply involved in programming theory, I thought it best to ask here. Regarding the P NP problem, this excerpt from http://en.wikipedia.org/wiki/P_versus_NP_problem : "In essence, the question P = NP? asks: Suppose that yes answers to a yes or no question can be verified quickly. Then, ...

Master's Method, which Case?

I've been viewing some video lectures from MIT's opencourseware website, and on the third lecture video the lecturer goes over Recursive Matrix Multiplication and comes up with the time complexity being: T(n) = THETA(n^3). It's obvious to me that I really need to review some of my math, but I really don't see the connection from that a...

Measuring code complexity of functional language and imperative language

What is the best way of comparing code complexity of functional language and imperative language? In my case I have to compare complexity of certain programs written in F# and C++. As for now as a code quality measure I am using lines of source code. ...

Why the move from O(1) scheduler to CFS which is O(log N)?

I might be a little late on this but I was going through how various production schedulers work recently and I came across the O(1) scheduler which was replaced by the Completely Fair Scheduler, or CFS, both by Ingo Molnár. As the name suggests the O(1) scheduler takes constant time but CFS is O(log N). Then why was such a move made? Ob...

What are NP problems?

I read the article on wikipedia but could not understand what exactly are NP problems. Can anyone tell me about them and also what is relation of them with P Problems? ...

Practicing programming : solving crescent difficulty problems

Hello there. As everyone knows, real life problems when it comes to programming are numerous and often unexpected. Sometimes, those problems even are hard to solve, and without being trained to recognize them, you can quickly get stuck. I like challenge, because the more you get confronted to a recurrent situation, the less time you nee...

What is the complexity of a circular doubly linked list using binary search?

Is it O(n log n) or O(log n)? ...

How to estimate complex algorithm facility requirements?

I'd like to understand how to efficiently estimate hardware requirements for certain complex algorithms using some well known heuristic approach. Ie. I'd like to estimate quickly how much computer power is necessary to crack my TEA O(2^32) or XTEA O(2^115.15) in some reasonable time or other way round : Having facility power of a 1000 x...

Kolmogorov Complexity Approximation Algorithim

Hi, I'm looking for a algorithim that can compute an approximation of the Kolmogorov complexity of given input string. So if K is the Kolmogorov complexity of a string S, and t represents time, then the function would behave something like this.. limit(t->inf)[K_approx(t,S)] = K. ...

Does recursive method increase cyclomatric complexity

Hi all: I do not have any programs installed for measuring cyclomatric code complexity at the moment. But I was wondering does a recursive method increases the complexity? e.g. // just a simple C# example to recursively find an int[] // within a pile of string[] private int[] extractInts(string[] s) { foreach (string s1 in s) ...

how to find maximum value stored in stack in constant time.

Using a temp variable to store max value does not work for pop operations. ...

help in find complexity of this algorithm

Hi, i try to find the complexity of this algorithm: m=0; i=1; while (i<=n) { i=i*2; for (j=1;j<=(long int)(log10(i)/log10(2));j++) for (k=1;k<=j;k++) m++; } I think it is O(log(n)*log(log(n))*log(log(n))): The 'i' loop runs until i=log(n) the 'j' loop runs until log(i) means log(log(n)) the 'k' loop runs until k...

What will be the time complexity of the following algorithm ?

for(i=0;i< m; i++) { for(j=i+1; j < m; j++) { for(k=0; k < n;k++) { for(l=0;l< n;l++) {if(condition) do something} } } } ...

What's the big O of this little code snippet?

for i := 1 to n do j := 2; while j < i do j := j^4; I'm really confused when it comes to Big-O notation, so I'd like to know if it's O(n log n). That's my gut, but I can't prove it. I know the while loop is probably faster than log n, but I don't know by how much! Edit: the caret denotes exponent. ...

looking for link to runtime complexity and/or benchmarks table for JAXB

Hi all, I think the title should be pretty clear, but: I am looking to determine what kind of performance I can expect from a software component that is running JAXB--both for marshal and un-marshal operations. I'd hoped to find a page of benchmarks, or some sort of white paper that spoke about complexity, but my web searches haven't tu...

non-monotonic complexity algorithm

as a thought exercise, I try to think of algorithm which has nonmonotonic complexity curve. only thing I could think of was some algorithm with asymptotic solution in extremities. Is there such algorithm, which has nonmonotonic complexity curve, which does not rely on asymptotic approximation? ...

Count the number of operations for a sorting algorithm

This is my assignment question: Explain with an example quick sort , merge sort and heap sort . further count the number of operations, by each of these sorting methods. I don't understand what exactly i have to answer in the context of " count the number of operations " ? I found something in coremen book in chapter 2, they have expla...

Space complexity question

Possible Duplicate: Regarding in-place merge in an array I have an array, where the first and second half of the array is sorted, e.g. A[] = "2 4 7 1 5 20" No how do I sort the whole array in O(1) space complexity? Regards, Mithun ...