![]() |
Challenge 9 - Quick sort - Printable Version +- Small Basic Forum (https://litdev.uk/mybb) +-- Forum: Small Basic (https://litdev.uk/mybb/forumdisplay.php?fid=1) +--- Forum: Challenges (https://litdev.uk/mybb/forumdisplay.php?fid=5) +--- Thread: Challenge 9 - Quick sort (/showthread.php?tid=152) |
Challenge 9 - Quick sort - litdev - 10-28-2024 Implement quicksort algorithm and sort 1000 random numbers. Interesting to see if it's easier the usual way understanding the algorithm and writing the code or getting AI to do it for you? RE: Challenge 9 - Quick sort - AbsoluteBeginner - 10-28-2024 This is a very interesting task. ![]() Plus I'll be able to compete against my Copilot. Hello everyone, friends. ![]() RE: Challenge 9 - Quick sort - jrmrhrb00 - 10-28-2024 QZVX574.000 Why doesn't this program work? It' just using LDArray.sort! JR RE: Challenge 9 - Quick sort - AbsoluteBeginner - 10-28-2024 (10-28-2024, 12:39 PM)jrmrhrb00 Wrote: QZVX574.000 Hello. I think the program doesn't work because the LDArray.Sort() method is designed to work with arrays created by the LDArray.Create() method. In my opinion, this method does not work with SB array. Because these arrays are different from each other, the LDArray array works much faster than the SB array. RE: Challenge 9 - Quick sort - jrmrhrb00 - 10-28-2024 AB, I agree with you in that it has to be a ldArray. So, here's the updated program. Still doesn't work. JXNC572.000 JR RE: Challenge 9 - Quick sort - AbsoluteBeginner - 10-28-2024 (10-28-2024, 04:22 PM)jrmrhrb00 Wrote: AB, One of the errors: status[i]=Math.GetRandomNumber(10) There should be: LDArray.SetValue(status, i, Math.GetRandomNumber(10)) RE: Challenge 9 - Quick sort - z-s - 10-28-2024 I guess this is error ![]() Code : PHP Code: 'small basic array What results this show: PHP Code: result=LDArray.Sort(status) So after AB fix you have to make the last loop like this: PHP Code: For i = 1 To 10 RE: Challenge 9 - Quick sort - jrmrhrb00 - 10-28-2024 AB,Z-S, None of the suggested fixes worked. I guess I'll wait on LitDev. He is always good at figuring these things out. JR RE: Challenge 9 - Quick sort - AbsoluteBeginner - 10-28-2024 (10-28-2024, 05:33 PM)jrmrhrb00 Wrote: AB,Z-S, This is because we haven't fixed all the bugs yet. Can you paste the latest version of your code into your new message? RE: Challenge 9 - Quick sort - jrmrhrb00 - 10-28-2024 AB, L-S, I went back to basically the same code. JR JXNC572.000 |