-
January 6th, 2011, 02:57 PM
#1
Big O and recursion
Hi,
I have read about 30 websites, and several articles on the topic, but nothing has really done a good job of explaining how to calculate the big o of a recursive function. Hopefully someone here might be able to offer some insight.
Here is a quick outline of my code.
Code:
void solveFunction(variables) {
while(!eof) {
for () {
for () {
recursiveFunction()
}
}
}
}
bool recursiveFunction (variables) {
for () {
for () {
recursiveFunction()
}
}
}
So based on what I have read, my while loop is O(1) + 2 for loops = O(n^2) + the recursive function.
The recursive function alone is O(n^2) + recursive function.
Can anyone tell me if im on the right track, what I might be doing wrong, and help me figure out what the big o of this might be?
I am really at a loss and any help would be greatly appreciated.
Thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|