XIAOCHONG
Wednesday, 18 September 2013
Complexity of the method
Complexity of the method
I was asked this in an interview.WHat is the complexity of this method??
static int magic(int n) {
System.out.println( count+" "+ n);
count++;
return (n < 2) ? n : magic(n - 1) + magic(n - 2);
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment