Thread: STL - Maps

  1. #1
    Registered User
    Join Date
    Sep 2003

    STL - Maps

    Is there a way to estimate the amount of time it will take to use a map, given the number of elements it contains and the operation being done to the map (e.g. addition, subtraction, division, etc.)? If I am running an application at a high frequency, is it a good idea to use maps?

  2. #2
    Hardware Engineer
    Join Date
    Sep 2001

    Lightbulb Look-up "Big-O Notation"

    (That's big-oh, not big zero)

    This gives you the relative time that an operation takes, depending on the number of elements. That is - if you double the number of elements, does the time operation change at all? Does it double? Does it quadruple?

    You still have to test the program to see how long the operations will take. Then Big-O will help you estimate the time with larger data sets.

    Here's a link with some info about Big-O and the STL. I didn't thoroughly read it... but it shows what the Big-O numbers mean:
    1) Constant
    2) Logarithmic
    3) Linear
    4) Amortized
    Last edited by DougDbug; 09-03-2003 at 05:22 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problems with strings as key in STL maps
    By all_names_taken in forum C++ Programming
    Replies: 3
    Last Post: 01-17-2006, 11:34 AM
  2. Hash_map, STL maps query
    By alvifarooq in forum C++ Programming
    Replies: 15
    Last Post: 06-07-2005, 09:07 AM
  3. For those knowing STL maps...
    By supaben34 in forum C++ Programming
    Replies: 8
    Last Post: 12-01-2003, 04:41 AM
  4. Prime Number Generator... Help !?!!
    By Halo in forum C++ Programming
    Replies: 9
    Last Post: 10-20-2003, 07:26 PM
  5. include question
    By Wanted420 in forum C++ Programming
    Replies: 8
    Last Post: 10-17-2003, 03:49 AM