why we take “default_size” in the heap?please explain in detail
Why we take "default_size" in the heap?
hello @gk1293123
we are using vector for heap implementation.
and when vector gets full , it double its size which is time consuming.
so to avoid it , we are reserving size(default size) for vector. that will help in reducing the number of doubling operation on vector.
read about reserve function for clartiy=> link
note -> if user provide its own heap size then it we will use the provided size in place of default size
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.