Lec-45: SELECTION SORT in PYTHON 🐍 | DSA Concepts in PYTHON 🐍

Поделиться
HTML-код
  • Опубликовано: 27 окт 2024

Комментарии • 28

  • @Niki-ue6fk
    @Niki-ue6fk 5 месяцев назад +4

    Hi, Thanks for the explanation . Somehow , i think , a little change in indentation needed. Bcz, its not working for all the elements. so we have to change the index like i have shown below.
    def selectionsort(arr):
    n = len(arr)
    for i in range(n-1):
    mini = i
    for j in range(i+1,n): #

  • @RoshanSingh-kj4fy
    @RoshanSingh-kj4fy Месяц назад

    I've attended multiple classes but ur simplicity is osam

  • @JupudiManikantaSwamy
    @JupudiManikantaSwamy 10 месяцев назад +1

    I appreciate you taking the time to explain that. Thank you.

  • @punitarora8664
    @punitarora8664 Месяц назад

    Great explanation sir

  • @yajushvyas2916
    @yajushvyas2916 10 месяцев назад +4

    Sir there is a mistake in pass 2, at 07:59 mini = 2 so after swapping in 09:07 when we will compare 42 we will compare it with 41 because mini = 2 and arr1[mini] = 41

    • @Hello_BhaiG
      @Hello_BhaiG 2 месяца назад

      bhai code hi galat likha hai sir ne

  • @unknownstudentkkn
    @unknownstudentkkn 9 месяцев назад +4

    sir iss video ko agar aap edit ya delete kar denge to bahut achha hoga kyunki isme error hai jisko aur bhi logo ne point out kiya hai aur jo pahli bar dekhenge wo samjhenge ki likha hua code hi sahi hai isliye please take a proper action.....
    swapping second loop complete hone ke baad ki jayegi...

  • @Deeksha7star
    @Deeksha7star 11 месяцев назад +7

    Sir ye swapping j loop ke bhar m hogi

    • @Rohan-rr7jw
      @Rohan-rr7jw 11 месяцев назад +4

      Yes bro you are right

  • @aniketdev1157
    @aniketdev1157 7 месяцев назад

    Thank you so much sir 🙏❤️

  • @gtsumit7067
    @gtsumit7067 6 месяцев назад

    Hey,
    The line which you use for swapping will inside the first loop only as it's inside the second loop it could give wrong answer when there is a bigger array

    • @Hello_BhaiG
      @Hello_BhaiG 2 месяца назад

      yup bro, the code is wrong. because of this video i waste my 2 hours, why i cant understand the logic and then after i realise the code is wrong so shameful teacher

  • @talhajawad020
    @talhajawad020 6 месяцев назад +3

    where the increment code of j exists in program?

    • @T_E_D_D_Y_0_0_7
      @T_E_D_D_Y_0_0_7 5 месяцев назад

      In python the by default increment value is 1 so you can omit that part if you want to increase by 1.

  • @wbinvestor7717
    @wbinvestor7717 9 месяцев назад

    There is a typing mistake in line no 8.
    The swapping must be done in the same indentation of the second for loop.
    Hope everyone evaluates correctly.

  • @kareenatulyani24
    @kareenatulyani24 9 месяцев назад

    Thankuuu sir❤

  • @Shaikh_Imran9977
    @Shaikh_Imran9977 9 месяцев назад

    You consider n=5 but you run Nested For loop of j just 4 times why?

  • @niharikakadiyan8994
    @niharikakadiyan8994 Год назад

    Sir baaki sorting program b karwa do ... pgt k exam se phle

  • @Deeksha7star
    @Deeksha7star 11 месяцев назад

    Sir heap sort b krado plz

  • @RajRaj-sp7xw
    @RajRaj-sp7xw 4 месяца назад

    This code is not working for more than 5 elements.Could u help sir 🙏

    • @Hello_BhaiG
      @Hello_BhaiG 2 месяца назад

      swapping wali 8th line inner loop se hata kar outer loop me laado, code me mistake h sir k

  • @argaming9110
    @argaming9110 Год назад

    Thanks sir

  • @md.mansoor6446
    @md.mansoor6446 2 месяца назад

    This program is not giving proper output for some arrays

  • @AmishaJaiswal-qm4ek
    @AmishaJaiswal-qm4ek 4 месяца назад +3

    it should be arr[j]

  • @shitikanthparida8270
    @shitikanthparida8270 Год назад

    The 1st comment in Sir's video ❤️

  • @jyotibhardwaj293
    @jyotibhardwaj293 Год назад

    Sir baki bi kerwa dijiye