Vanadium 50 said:
That sounds a lot like "I'll cheat somewhere else, thank you". I'm sure you can get an answer somewhere. I am not sure that the skill of Googling places to steal borrow other's work is as marketable as people seem to think it is.
What you should do instead is to run quicksort by hand with a small number of values to see what it is doing. Do this a few times with varying lengths and varying orders until you learn what quicksort is doing. Then you can answer the question on your own.
Hello, Vanadium 50!
Thank you for providing me a hint of Quicksort -- by testing "varying lengths"!
Before I posted this thread, I do understand how it works, which it compares and put the last element of array to the position that the left side elements are less that it and the right side elements are greater or equal it. Also, I spent about 15 min on this question after I have done another exercise for Quicksort.
From my textbook, I think it does not provide any info for the best-case scenario from my understanding of reading.
About the skill of Googling, I do agree that people are doing it a lot, including me, which is not a good habit since people will not learn much. However, the reason that I did not google my question before I come to here first is that here could provide some hints, or walk me through questions and let me understand more questions' requirements, as Mark44 has clarified about my guess is impossible. And I did spend some time on it again, but I did not get it, so I asked for help again if possible by providing me an example.
I did spend a lot of time on this problem but did not get any progress. I am a human, so I will get frustrated, but I still want to complete it if possible. I did ask my professor by email, but since his office hours are not today, I think I will not get responded soon.
So yes, about the skill of Googling, I did use it to find useful info if possible, but I still cannot find any example. However, I did get a hint from an idea, as you said, try to test "varying length." -- always cut the array into half repeatedly will provide the best-case scenario. And I did figure out the answer at the end for n = 15. I think my answer is correct when I used Quicksort to process, and it came out with a good result.
If you want to help me check my calculated answer, I can post here. Dada