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

КОМЕНТАРІ • 99

  • @nithunraj7752
    @nithunraj7752 2 роки тому +5

    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!!

  • @hit_420
    @hit_420 2 роки тому

    Appreciation from my side. When I have any doubt, I come to see your videos to clear those..

  • @nilimathorat4540
    @nilimathorat4540 2 дні тому

    ❤❤❤❤ Nice explanation and for your hard work.

  • @slater-cguy
    @slater-cguy Рік тому +1

    The best DSA lectures on youtube, thank you, @AmulsAcademy !

  • @srikanthboora2525
    @srikanthboora2525 4 роки тому +3

    Mam ur way of speech is very good,with clear voice nd explaination

  • @masoom5320
    @masoom5320 4 роки тому +7

    wasted whole day t learn but at the end I learned here

  • @anshulvairagade1604
    @anshulvairagade1604 4 роки тому +1

    Mam, you are a superwoman, you teaches so nicely, thanks for the hard work you are doing for us.

  • @hereweare644
    @hereweare644 3 роки тому

    I can't find a teacher like you

  • @balakrishnavaidyanathan8572
    @balakrishnavaidyanathan8572 4 роки тому +3

    Great quick sort.you can do ascending or descending order.great video

  • @narora8459
    @narora8459 3 роки тому +2

    Great explanation fantastic...😇😇😘😘

  • @maqsoodalammansoori6189
    @maqsoodalammansoori6189 5 років тому +6

    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.

    • @AmulsAcademy
      @AmulsAcademy  5 років тому +2

      def pivot_place(list1,first,last):
      pivot=list1[first]
      left=first+1
      right=last
      while True:
      while left

    • @narsimhareddy4742
      @narsimhareddy4742 3 роки тому

      @@AmulsAcademy even I am getting Sam error mam

    • @HarshSharma-ow2pe
      @HarshSharma-ow2pe Рік тому

      @@AmulsAcademy error geetting in this code please gave another example for this.

    • @HarshSharma-ow2pe
      @HarshSharma-ow2pe Рік тому

      hi bro ,if you have clear this error then please tell me how

    • @HarshSharma-ow2pe
      @HarshSharma-ow2pe Рік тому

      ​@@AmulsAcademytell me mam

  • @shreyabag64
    @shreyabag64 Рік тому

    it is a great tutorial.thank you so much for this

  • @shubhamdudhe673
    @shubhamdudhe673 4 роки тому +4

    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 ❤

  • @SachinYadav-qe3gb
    @SachinYadav-qe3gb 3 роки тому

    Thanks, I saw lots of video but only here I understand. Once again thanks

  • @shivamingle2157
    @shivamingle2157 4 роки тому +1

    Mam, very very very very thank u.
    Amazing Explanation Thank u.

  • @sabujosephvld
    @sabujosephvld 3 роки тому +1

    Mam how can I sort integers in a queue in descending order without using built functions

  • @slc388
    @slc388 3 роки тому

    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

  • @shanmugarajs4309
    @shanmugarajs4309 2 роки тому

    Explain clearly ,thanks

  • @sivasurya4149
    @sivasurya4149 4 роки тому

    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..

  • @naiduadhikari1014
    @naiduadhikari1014 3 роки тому +1

    it is raising index out of range when we give input [5,4,3,2,1]..once check

    • @AmulsAcademy
      @AmulsAcademy  3 роки тому

      Give me the program I will check :)

    • @naiduadhikari1014
      @naiduadhikari1014 3 роки тому

      @@AmulsAcademy please check with ex 5,4,3,2,1 I'm getting index out of range

  • @chhusnain9773
    @chhusnain9773 3 роки тому +1

    how sublists are sorted recursively i dont understand that when you writye quick sort function can you please explain me

    • @AmulsAcademy
      @AmulsAcademy  3 роки тому

      Take one example and trace the program 😊

  • @shreyasipaul7767
    @shreyasipaul7767 3 роки тому +1

    U r the bEst❤️

  • @kireetikesani9422
    @kireetikesani9422 4 роки тому +1

    Hello,Mam when u will statt data structures in python??,we are waiting for that

  • @verryberrypie
    @verryberrypie 3 роки тому +1

    amazing tutorial. Do you think you could do a tutorial on quick select?

  • @432aniketkadam4
    @432aniketkadam4 3 роки тому

    Please make video on krushkal Minimum spanning tree

  • @Shivam_Manswalia
    @Shivam_Manswalia 4 роки тому +1

    Thankyou You are amazing.

    • @AmulsAcademy
      @AmulsAcademy  4 роки тому +1

      Glad to hear that :)

    • @Shivam_Manswalia
      @Shivam_Manswalia 4 роки тому +1

      @@AmulsAcademy hey I need help can you please suggest me topics that I must learn to get a job pleeeease.

    • @AmulsAcademy
      @AmulsAcademy  4 роки тому +1

      Be clear with at least one language and also few programs like prime numbers pattern programs...

  • @phaneendragajawada6476
    @phaneendragajawada6476 4 роки тому +1

    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

    • @AmulsAcademy
      @AmulsAcademy  4 роки тому

      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 :)

  • @saitarun6562
    @saitarun6562 5 років тому

    iam noticed that you said 14:21 right

    • @sridharraj1398
      @sridharraj1398 4 роки тому

      She is checking index value not the list value that is 5

  • @ramyad5362
    @ramyad5362 Рік тому

    thank you mam☺

  • @faheemashraf6051
    @faheemashraf6051 6 років тому +1

    Thank You>>>>>>>>>>>>>>>>>>>>>>

  • @muktesh_gautam
    @muktesh_gautam 5 років тому +1

    Thanks Mam, I really like your teaching style! : )

  • @surajagasti2309
    @surajagasti2309 4 роки тому +1

    cant we use for loop for execution

  • @nachiappanrm1915
    @nachiappanrm1915 6 років тому

    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?

  • @rahulsanapathi2305
    @rahulsanapathi2305 8 місяців тому

    why did you use while true what is the meaning

  • @Indian-fh8hf
    @Indian-fh8hf 5 років тому +1

    please make a video on "LINKED LIST "

  • @debojitmandal8670
    @debojitmandal8670 3 роки тому

    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

  • @najeebhafeel5180
    @najeebhafeel5180 3 роки тому +1

    Madam It is very useful if u post hackerrank solutions

  • @harsimrankaur9845
    @harsimrankaur9845 3 роки тому

    Ma'am , What's the time complexity of pivot_place function?

  • @rajeshjain1204
    @rajeshjain1204 2 роки тому

    Easy explanation but it's showing a error TypeError unsupported operand type(s) for 'NoneType' and 'int'

  • @adityaranjanbehera7963
    @adityaranjanbehera7963 5 років тому +1

    Can you help me mam, why this swapping method is not working ?

    • @AmulsAcademy
      @AmulsAcademy  5 років тому

      Give me the program i will check :)

  • @sripoojithak6327
    @sripoojithak6327 5 років тому +1

    Getting error as unsupported operand type for -: ' NoneType' and 'int'

    • @rinkeedebnath
      @rinkeedebnath 3 роки тому

      I'm also getting this same error...if you know the solution please let me know

    • @rajeshjain1204
      @rajeshjain1204 2 роки тому

      Same here

  • @krishnavamsinadharikatla5150
    @krishnavamsinadharikatla5150 6 років тому +1

    Thank you very much mam

  • @smileplz1334
    @smileplz1334 6 років тому +1

    Mam, how to replace Input with Replace Module

    • @AmulsAcademy
      @AmulsAcademy  6 років тому

      list1 = []
      list1 = [eval(input(":")) for i in range(5)]
      print(list1)
      list1[2] = "hello"
      print(list1)
      :)

    • @smileplz1334
      @smileplz1334 6 років тому

      @@AmulsAcademy
      Print("Thanks ")

  • @shafavp9894
    @shafavp9894 5 років тому +1

    Please do linked List in python

  • @rajkir2852
    @rajkir2852 4 роки тому

    What is p = pivot_place(list1,first,last) ?

    • @payalsaha7444
      @payalsaha7444 4 роки тому

      pivot_place function is returning the right index which is stored in p

  • @_rupeshchauhan
    @_rupeshchauhan 5 років тому +1

    mam how to accept the list from user

    • @AmulsAcademy
      @AmulsAcademy  5 років тому

      You can use list comprehension method.
      :)

  • @bhagiyarajmahesh8972
    @bhagiyarajmahesh8972 3 роки тому

    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.

  • @kireetikesani9422
    @kireetikesani9422 4 роки тому +1

    Thnak U madam

  • @kgmohanachandran599
    @kgmohanachandran599 3 роки тому +1

    It is totally complicating when compared to other similer vedios.

  • @siddappagodi6068
    @siddappagodi6068 Рік тому

    Mdm how to exicute program repeat

  • @vigneshkumar5634
    @vigneshkumar5634 5 років тому +1

    def pivot_place(list1,first,last):
    pivot=list1[first]
    left=first+1
    right=last
    while True:
    while left

  • @krishnavamsinadharikatla5150
    @krishnavamsinadharikatla5150 6 років тому +2

    Please do program on tower of Hanoi mam

  • @satyamsharma9920
    @satyamsharma9920 5 років тому +1

    thanks SIR