Let us define the memory utilization of a container as the portion of the total
ID: 3866114 • Letter: L
Question
Let us define the memory utilization of a container as the portion of the total memory dedicated to a container that actually holds the contained data elements. For example, if a container occupies a total of 1000 bytes, and is currently holding 10 items, each of which is 20 bytes long, then the container would have a (10" 20)/1000 = 0.2 = 20% memory utilization. Assuming that we have only added elements and never removed any, what is the approximate worst-case (lowest) utilization for a std:: vector containing N elements, for reasonably large N? 0% 5% 25% 33% 50% 67% 75% 90% 100%Explanation / Answer
if we add 5 items of 10 byte long then the lowest utilization is
5*10/1000=.05
5%
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.