Forum: Computer Science Oct 4th, 2008 |
| Replies: 4 Views: 1,177 The honest truth is, I don't know when an inequality sign or when an equal sign should be used. I'm struggling to understand algorithm analysis. I more or less understand the examples in my text book... |
Forum: Computer Science Oct 4th, 2008 |
| Replies: 4 Views: 1,177 I don't quite get it. (j+1) is the number of time the loop runs and n is the number of elements you have in the array so wouldn't substituting the n in mean running the loop (n+1) times? |
Forum: Computer Science Oct 3rd, 2008 |
| Replies: 4 Views: 1,177 I need help with finding a function T(n) that describes the upper bound for the worst case running time of this algorithm:
1. maxS = 0
2. n = A.length
3. for j from 0 to n − 1 do
4. ... |