
3 Mar
2009
3 Mar
'09
1:01 p.m.
Frank Mori Hess skrev:
On Tuesday 03 March 2009, Thorsten Ottosen wrote:
Steven Watanabe skrev:
AMDG
Thorsten Ottosen wrote:
I don't know. I just stay clear of it. The point is that we don't want inexperienced users to use an O(n) swap accidently. Please define n. n would be c.size()
n needs to be stack capacity if you want to call it O(n) swap. If n is size(), then swap becomes O(1) since once you get large enough to fall back on dynamic allocation you can just swap the pointers.
Let me call is a linear time swap for n >= N. -Thorsten