#Exception thread can't figure out why
31 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @night elm! Please use
/closeor theClose Postbutton above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
screenshot of error
I think the error is how I am calling it as the error disappears when I do not call it
You're double incrementing the i variable in the partition for loop. That could be an issue
It would be better if you didn't screenshot your code
And actually posted it here in a format
So people could test it and see if they need to
Hey, I didn't get the notification so my bad for the late response.
Don't know if you still want the code but here it is.
because you do int j = (low-1); // indicates greater element
then unsorted_array[j] = unsorted_array[i];
and call that method with low argument as 0. so j = 0-1 == -1
so unsorted_array[-1] - out of bounds
Oof
Calling with 1 does not properly sort it, can you explain what I need to change to get it to sort properly?
Thank you
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
you're welcome
I'll try that article out and come back if I have any bugs that I can't fix
I genuinely can't find, is it around the calling of the method or in the declaration?
you need j++ instead of i++
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
I will close now
np 😉