Show segmentation fault error
@jatinkumarjk2001 hey ,in line 11 :while((a[s.top()]>a[i]) && !s.empty())
write empty wali condition pehle than dusri wali kyunki pehli wali condition pehle check hoti hai than next agr hmara stack emty hua aur pehli condition check hogyi to woh error dega jaisa apka arha hai.Hope ypu get it.
or waise bhi agar hmara stack empty hua toh pehli condition check nhi hogi or or niche s.push(i) h wo hojayega according to preavious code
@jatinkumarjk2001 bhai mene ye code submit krke bhi dekh lia its workinf fine ,mene apki galtiyan comment krdi hai ,please see to it :
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.