If my string s size is n and I do something like
s.resize(c); // c < n
will it take constant time or linear?
What will it be in case of c > n.
This is a discussion on resize funtion complexity within the C++ Programming forums, part of the General Programming Boards category; If my string s size is n and I do something like s.resize(c); // c < n will it take ...
If my string s size is n and I do something like
s.resize(c); // c < n
will it take constant time or linear?
What will it be in case of c > n.
Manasij Mukherjee | gcc-4.8.0 @Arch Linux
Slow and Steady wins the race... if and only if :
1.None of the other participants are fast and steady.
2.The fast and unsteady suddenly falls asleep while running !
O_o
The size is not the same as capacity.
If you want to fit the capacity to the contents you'll have to depend on a linear solution or one that isn't portable.
Soma