Already sorted list is a worst case scenario for quick sort. Try to execute the algo on sorted list and you will get your answer. You may also check this link: www.geeksforgeeks.org/when-does-the-worst-case-of-quicksort-occur/amp/
In Quick Sort, where the leftmost (or rightmost) element is chosen as a pivot, the worst occurs in the following cases. 1) Array is already sorted in the same order. 2) Array is already sorted in reverse order. 3) All elements are the same (a special case of cases 1 and 2) For reference: www.geeksforgeeks.org/when-does-the-worst-case-of-quicksort-occur/amp/
Mam I got question bank book of gate Exam... But I couldn't get the last question you mentioned gate 2014... 2016.. ¡ am preparing for trb CS..... For that I preparing net gate questions .... I couldn't get such question in book.... That's y asked
Awesome
Always provide MCQ at the end of topic
:)
Good explanation.. Thank you madam
:)
Question on 06:00 - I think first list is already in ascending order so it is best case for it. Please explain how is it worst case ?
Already sorted list is a worst case scenario for quick sort. Try to execute the algo on sorted list and you will get your answer. You may also check this link: www.geeksforgeeks.org/when-does-the-worst-case-of-quicksort-occur/amp/
@@computershastra Thank you
😊
Thanku mam
: )
Thank you.
😊
Quick sort question, when the elements are already sorted then it's Best case. How can that be worst case?
In Quick Sort, where the leftmost (or rightmost) element is chosen as a pivot, the worst occurs in the following cases.
1) Array is already sorted in the same order.
2) Array is already sorted in reverse order.
3) All elements are the same (a special case of cases 1 and 2)
For reference: www.geeksforgeeks.org/when-does-the-worst-case-of-quicksort-occur/amp/
mam sorting algorithm wali video kaa link kaam nhi kr rha..
Plz try again, analysis of sorting algo linkis working
Here is the link: th-cam.com/video/ji6xhgm2iXI/w-d-xo.html
Mam I got question bank book of gate Exam... But I couldn't get the last question you mentioned gate 2014... 2016.. ¡ am preparing for trb CS..... For that I preparing net gate questions .... I couldn't get such question in book.... That's y asked
Oh ok.. This question was given on geeks for geeks
👍🙏
:)
iski PDF mil skti hai kya madam ji
I am sorry sir, it is not feasible for me. If you want you can take screenshot of each question.
@@computershastra ok no problem
i will write all these questions in my notebook for further revision.
thanks for teaching 🙏🙏
Thank you sir