Click to See Complete Forum and Search --> : Time consumed_


hometown
May 2nd, 2003, 12:29 PM
If I use vector class's functions to search my data, could you tell
me how I will know how fast its predefined algorithms will be. In order to be more precise about what I mean, if we, for instance, write a certain kind of algorithm to perform the searching task, we can compute the time taken for its performance, something like T(n^2) or T(nlogn),etc, but if it is already defined functions, how can we compute it ?

Thank you very much...
Regards,
Nina.

Paul McKenzie
May 2nd, 2003, 12:33 PM
Originally posted by hometown
If I use vector class's functions to search my data, could you tell
me how I will know how fast its predefined algorithms will be. In order to be more precise about what I mean, if we, for instance, write a certain kind of algorithm to perform the searching task, we can compute the time taken for its performance, something like T(n^2) or T(nlogn),etc, but if it is already defined functions, how can we compute it ?

Thank you very much...
Regards,
Nina. The search time for a vector is (and must be) linear -- O(n).

Regards,

Paul McKenzie

hometown
May 2nd, 2003, 01:22 PM
Regards,

Nina.

PaulWendt
May 2nd, 2003, 02:00 PM
I just want to add that a good reference source will allow you to
look up this information yourself. One such source is "The C++
Standard Library" by Nicolai M Josuttis.

hometown
May 2nd, 2003, 02:15 PM
Regards,
Nina.