Python Tutorials - Quick Sort Algorithm | Program | Part-1
Вставка
- Опубліковано 25 січ 2025
- In this Python programming video tutorial we will learn about how to sort the number using quick sort algorithm in detail.
Quicksort algorithm is also called as "partition exchange sort" algorithm it is developed by Tony Hoare in 1959 and published in 1961 so it is one of the commonly used sorting algorithm.
Quicksort algorithm when implemented well it can be about 2 or 3 times faster than the merge sort and heapsort. I guess that's why the name Quicksort.
Quick sort is the comparison sort algorithm so here also we will compare the values, to rearrange the list we will compare the values.
It is in_place algorithm so that is nothing but it may require small additional amount of memory to perform the sorting but it is the in place sorting.
And It is unstable algorithm that is nothing but the relative order of equal sort item is not preserved like, if you are sorting a list and it contains the duplicate values the order they will appear in the input may not be the same in the output.
Selection Sort Algorithm And Program:
• Python Tutorials - Sel...
• Python Tutorials - Sel...
• Python Tutorials - Sel...
• Python Tutorials - Sel...
Bubble Sort Algorithm and program:
• Python Tutorials - Bub...
• Python Tutorials - Bub...
Quick sort algorithm and example:
• Python Tutorials - Qui...
• Python Tutorials - Qui...
Swapping Program:
• Python Tutorial - Prog...
#PythonProgramming #SortingAlgorithm #QuickSort
For more free tutorials on computer programming
/ amulsacademy
/ amulsacademy
Usually I don't spare time for comments. But I can't really go back without appreciating you for this explanation and easy code. Thank you!!
Appreciation from my side. When I have any doubt, I come to see your videos to clear those..
❤❤❤❤ Nice explanation and for your hard work.
The best DSA lectures on youtube, thank you, @AmulsAcademy !
Mam ur way of speech is very good,with clear voice nd explaination
wasted whole day t learn but at the end I learned here
Thank you :)
Is your code running without any error ????
Mam, you are a superwoman, you teaches so nicely, thanks for the hard work you are doing for us.
I can't find a teacher like you
Great quick sort.you can do ascending or descending order.great video
Thank you :)
Great explanation fantastic...😇😇😘😘
Thank you 😊
Traceback (most recent call last):
File "M:/Python/QuickSortTest.py", line 25, in
Quicksort(list1,0,n-1)
File "M:/Python/QuickSortTest.py", line 20, in Quicksort
Quicksort(list1,first,p-1)
TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'
> error is coming.
def pivot_place(list1,first,last):
pivot=list1[first]
left=first+1
right=last
while True:
while left
@@AmulsAcademy even I am getting Sam error mam
@@AmulsAcademy error geetting in this code please gave another example for this.
hi bro ,if you have clear this error then please tell me how
@@AmulsAcademytell me mam
it is a great tutorial.thank you so much for this
I always got confused how quick sort work but after seen ur vedio i did understand in better way, thank u so much mam for ur deeply explanation ❤
Most welcome 😊
Thanks, I saw lots of video but only here I understand. Once again thanks
Mam, very very very very thank u.
Amazing Explanation Thank u.
Most welcome 😊
Mam how can I sort integers in a queue in descending order without using built functions
same program i written in visual studio code but complier gives some mistakes but i follow proper indiation why it shows it shows like that so ple give me reply
Explain clearly ,thanks
Madam after swap the pivot position to right position .so right position is pivot.. right...after div the list again do same process but in the program no repeated the process..
it is raising index out of range when we give input [5,4,3,2,1]..once check
Give me the program I will check :)
@@AmulsAcademy please check with ex 5,4,3,2,1 I'm getting index out of range
how sublists are sorted recursively i dont understand that when you writye quick sort function can you please explain me
Take one example and trace the program 😊
U r the bEst❤️
Thank you :)
Hello,Mam when u will statt data structures in python??,we are waiting for that
amazing tutorial. Do you think you could do a tutorial on quick select?
Thank you :)
I will try :)
Please make video on krushkal Minimum spanning tree
Thankyou You are amazing.
Glad to hear that :)
@@AmulsAcademy hey I need help can you please suggest me topics that I must learn to get a job pleeeease.
Be clear with at least one language and also few programs like prime numbers pattern programs...
hi madam, how can we know when to use function and when not to use function???because in previous sel sork and quick sort we didnt use function and here u are using function so plz expalin that
If the part of code need to be executed again and again you need to use functions :)
In other cases if you want you can use functions :)
iam noticed that you said 14:21 right
She is checking index value not the list value that is 5
thank you mam☺
Thank You>>>>>>>>>>>>>>>>>>>>>>
My Pleasure :)
Thanks Mam, I really like your teaching style! : )
Thank you :)
cant we use for loop for execution
Yes :)
Mam, i am a cse student. i had python mini project in this semester! I don't have any idea abt that can u suggest me a best topic that seems to be the best one in our class ,mam?
why did you use while true what is the meaning
Same doubt
please make a video on "LINKED LIST "
Sure :)
But y list1 [ first ] and not list 1[pivot] where as you were able to take list 1[ right] but not pivot y.
Also in the recursive case why can't we use if condition i.e if list1> 1. As the base condition
Madam It is very useful if u post hackerrank solutions
I will try :)
Ma'am , What's the time complexity of pivot_place function?
O(logN)
Easy explanation but it's showing a error TypeError unsupported operand type(s) for 'NoneType' and 'int'
Can you help me mam, why this swapping method is not working ?
Give me the program i will check :)
Getting error as unsupported operand type for -: ' NoneType' and 'int'
I'm also getting this same error...if you know the solution please let me know
Same here
Thank you very much mam
Welcome:)
Mam, how to replace Input with Replace Module
list1 = []
list1 = [eval(input(":")) for i in range(5)]
print(list1)
list1[2] = "hello"
print(list1)
:)
@@AmulsAcademy
Print("Thanks ")
Please do linked List in python
What is p = pivot_place(list1,first,last) ?
pivot_place function is returning the right index which is stored in p
mam how to accept the list from user
You can use list comprehension method.
:)
How python knows that the first = the 0th INDEX of the list and the last= last index of the list? we've given it as arguments.
Thnak U madam
My Pleasure :)
It is totally complicating when compared to other similer vedios.
Mdm how to exicute program repeat
def pivot_place(list1,first,last):
pivot=list1[first]
left=first+1
right=last
while True:
while left
while True:
while left
Please do program on tower of Hanoi mam
Sure:)
thanks SIR
Pleasure :)