|
|
|
|
|
by Chattered
4235 days ago
|
|
I'm not sure on the specifics here, but I'd have thought that subtraction would be O(n). To perform n - m on a simple register machine with only increment, you just count from m up to n (and count from 0 up to n, outputting 0 if you reach n, since subtraction is partial). EDIT: It seems they are going for a naive implementation where subtract just repeatedly calls decrement, so yes, that's going to be O(m*n). |
|