error in quick sort c++ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

error in quick sort c++

I have been trying to write a quick sort algorithm in c++. But I am getting a strange error and confused how to fix it. please have a look. https://code.sololearn.com/c5tpKMujgejs

28th Sep 2021, 2:24 PM
Gajendra Sonare
Gajendra Sonare - avatar
8 Answers
+ 2
You need to put the partition function above the quicksort function or put the function signature above it so that it is in scope. That will solve the 1st problem.
28th Sep 2021, 2:50 PM
ChaoticDawg
ChaoticDawg - avatar
+ 1
Martin Taylor I know. It's just for the practice. I was actually waiting for this comment😂
28th Sep 2021, 3:47 PM
Gajendra Sonare
Gajendra Sonare - avatar
+ 1
ChaoticDawg okay. Thanks
28th Sep 2021, 3:58 PM
Gajendra Sonare
Gajendra Sonare - avatar
0
ChaoticDawg okay. That's a weird thing in c++. Thanks for answer
28th Sep 2021, 3:42 PM
Gajendra Sonare
Gajendra Sonare - avatar
0
Gajendra Sonare As I recall, all languages do have an already implemented sorting algorithm, don't worry much about their implementation, focus on the difference between them and when to use each one of them
28th Sep 2021, 3:46 PM
Maher Al Dayekh
Maher Al Dayekh - avatar
0
Gajendra Sonare Check out the implementations here. They may help you to find your remaining issue(s). https://www.sololearn.com/learn/669/?ref=app
28th Sep 2021, 3:51 PM
ChaoticDawg
ChaoticDawg - avatar
28th Sep 2021, 3:55 PM
Gajendra Sonare
Gajendra Sonare - avatar
0
Yes, it's a good exercise in learning how to use recursion in C++. It can sometimes even be given as homework or even an examination question to program your own implementation of quicksort in various languages
29th Sep 2021, 12:27 AM
Macross-Plus
Macross-Plus - avatar