Why after calling the QuickSort function it doesn't show the sorted array | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
23rd Jan 2021, 3:22 AM
zaya1235
zaya1235 - avatar
8 Answers
+ 4
George Ryan You mean you get output for original array and the sorted array? I can only see output of original array, but sorted array isn't showing. I think problem lies in `QuickSort` function, if I comment the line that calls `QuickSort`, then code runs ok. Although obviously the array is intact in second output.
23rd Jan 2021, 3:53 AM
Ipang
+ 1
Sigmentation fault it showing check your loops may be it going to be infinite times
23rd Jan 2021, 3:44 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 1
George Ryan Polymorphism doesn't play here, I take it you meant the forward declaration of QuickSort function at line 7?
23rd Jan 2021, 4:00 AM
Ipang
+ 1
George Ryan Ipang ♨️♨️ i found the error The brackets[] in 57 line were not in the right place It looked like this before : while(s_arr[right>middle]) ; That's why it didn't work
24th Jan 2021, 1:16 AM
zaya1235
zaya1235 - avatar
+ 1
Good job zaya1235 👍
24th Jan 2021, 6:41 AM
Ipang
0
I'm not sure what the problem is, all of the array items seem to print just fine
23rd Jan 2021, 3:44 AM
George Ryan
George Ryan - avatar
0
Segmentation fault? That's odd it works just fine for me.
23rd Jan 2021, 3:45 AM
George Ryan
George Ryan - avatar
0
Ipang Ah yeah, one of my guesses is it's a problem with polymorphism. They defined two different quick sorts, I'm not sure which one main is calling
23rd Jan 2021, 3:55 AM
George Ryan
George Ryan - avatar