why in dynamic array we increase the size by largest+1
Dynamic array understanding
There’s no compulsion that we have to make size of frequency array equals to largest + 1, you can keep it to largest only.
As you can see when we are reading frequency array , we are only iterating it from 0 to largest and not to largest + 1
Therefore it’s no compulsion in doing so.
If your doubt is solved. Please mark it as resolved.
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.