We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I think the problem you are facing would be a runtime error,which occured to me as well,
while**(j>=0&&temp<ar[j])**{//Since I had initially checked whether temp<ar[j] I had faced a runtimeerror.**temp<ar[j]&&j>=0)**but upon changing to the above order it got resolved.ar[j+1]=ar[j];j--;printArray(ar);}
Now the runtime error got resolved
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Insertion Sort - Part 1
You are viewing a single comment's thread. Return to all comments →
I think the problem you are facing would be a runtime error,which occured to me as well,
Now the runtime error got resolved