Dynamic allocation

where can we exactly use dynamic allocation becoz every question can also be solved with static array …
Or it’s just the matter of extra space???

@sharmalakshyarocks
Not every question can always be solved using static array. There are much more complex data structures than array like Trees and Linked Lists that you will learn later in this course. All of them use dynamic memory allocation.
As for array , we cannot always know the exact size of array required. If we take more , we are wasting space. If we take a lesser size , then we cannot store the data. Dynamic memory allocation helps us resolve that issue as well.

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.