Help me with this JAVA bug. (Quicksort Algorithm)

in #java6 years ago

So, yesterday I learned about the quicksort algorithm in JAVA. I watched a couple of youtube videos and then understood the concept of how it works. Later this morning, I tried writing its code in JAVA. Everything looked fine but after I executed that code, it showed me ArrayIndexOutOFBoundException as shown in the picture below:

I am here to seek help from the JAVA experts out there in this community. Here is the link to the code.

https://paste.ofcode.org/g33hJU8sUi63CC3jEHN5Cv

Sort:  

Congratulations @sugamadhiakri! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You made more than 100 comments. Your next target is to reach 200 comments.

You can view your badges on your Steem Board and compare to others on the Steem Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Hello @sugamadhiakri! This is a friendly reminder that you can download Partiko today and start earning Steem easier than ever before!

Partiko is a fast and beautiful mobile app for Steem. You can login using your Steem account, browse, post, comment and upvote easily on your phone!

You can even earn up to 3,000 Partiko Points per day, and easily convert them into Steem token!

Download Partiko now using the link below to receive 1000 Points as bonus right away!

https://partiko.app/referral/partiko

Congratulations @sugamadhiakri! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 1 year!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Do not miss the last post from @steemitboard:

SteemitBoard supports the SteemFest⁴ Travel Reimbursement Fund.
Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.20
TRX 0.26
JST 0.039
BTC 100104.47
ETH 3619.58
USDT 1.00
SBD 3.10