/bin/run.sh: line 4: 19 Segmentation fault (core dumped) ./exe
this is the error I am getting when i am increasing the size of dp [100][100][100] array from 100 to any value
this is my code please check
/bin/run.sh: line 4: 19 Segmentation fault (core dumped) ./exe
this is the error I am getting when i am increasing the size of dp [100][100][100] array from 100 to any value
this is my code please check
Check now.There must be some memory issue. Submit and check if it gives any error.
yes sir your given code worked ,but this is like bottom up[ approch iterative + memorisation. but in case of top down approach we have to pass dp array becaure top down is recursive + memorisation approch. so the problem is on passing large size dp in recursion in another question resulting in same error
please tell if we have large size dp array (2d array or may be 3 d array), how to pass them in recurssion
Maximum size of an integer 1d array in c++ can be of order 10^7. So you will not get a condition when total size of array increases 10^7.
In top down approach, instead of passing the dp array, you must declare it globally,outside the recursive function. And initialize this dp array in the main. This will work.
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.