[CSI] complexity of clear()

Mikhail Nesterenko mikhail at cs.kent.edu
Tue Feb 8 16:17:11 EST 2022


Never mind this was supposed to go to CS3 students,
--
Mikhail

Mikhail Nesterenko wrote:
> CS3 students,
> 
> The standard says that complexity of clear() is actually linear for
> both vectors and deques because clear() has to invoke destructors on
> every element that is being destroyed.
> 
> However, some implementations provide constant complexity for built-in
> types.
> -- 
> Mikhail
> _______________________________________________
> cs13001 mailing list
> cs13001 at cs.kent.edu
> https://listmail.cs.kent.edu/mailman/listinfo/cs13001


More information about the cs13001 mailing list