what?! map increases the memory usage ?!

I have always thought it is better to use a map instead of an associative array as it would help in conserving the memory. In TWODOGS problem I thought it is effiecient to use a map instead of 106 array as the ti can repeat in the given values. but the results are quite different. map version used 35.6 M and 106 associative array version used 8.9 M.

Screenshot from 2014-06-26 18:15:24

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s