QUICK SORT | Sorting Algorithms | DSA | GeeksforGeeks

QUICK SORT | Sorting Algorithms | DSA | GeeksforGeeks

GeeksforGeeks

7 лет назад

1,548,866 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Michel Daou
Michel Daou - 13.09.2023 11:27

not the best i watched

Ответить
totalynotfunny guy
totalynotfunny guy - 02.08.2023 21:19

I'm not sure if light green and white are the most eye-comfortable colors to read haha

Ответить
Siddhesh B. Kukade
Siddhesh B. Kukade - 06.07.2023 06:49

thanls

Ответить
nirmal singh
nirmal singh - 28.06.2023 07:14

The video sound is too irritating.

Ответить
ChubbyCat
ChubbyCat - 27.03.2023 19:46

Love it

Ответить
doumkatek Z
doumkatek Z - 23.03.2023 08:09

The explanation is pretty good watching it on my TV I can barely see the white text on the lake green background

Ответить
One piece
One piece - 24.12.2022 11:50

Thanks

Ответить
deepakkk
deepakkk - 24.08.2022 17:03

I feel it uses 2 pointer approach, we use i +1 to swap w larger values.

Ответить
yadhardha Official
yadhardha Official - 10.08.2022 06:49

awsm

Ответить
Fernando Rojas
Fernando Rojas - 26.07.2022 08:05

Quicksort will always be the most difficult sorting algo to explain, not very intuitive and too much index management. Ty for the video.

Ответить
Isaac8074
Isaac8074 - 19.07.2022 02:37

quick sort is so confusing to understand. How are pivots chosen?

Ответить
Clement_35
Clement_35 - 14.07.2022 04:20

Impossible to understand with this background music

Ответить
Anindita Ghosh
Anindita Ghosh - 14.06.2022 07:54

What if the least element is at the end of the array? Then considering it as the pivot element no swapping would occur as A[i] would not be <=pivot, then what happens to the first iteration?

Ответить
Tinotenda Mukaro
Tinotenda Mukaro - 09.06.2022 10:33

The background music is bullshit...🙂😡

Ответить
Mehmet Enes Onuş
Mehmet Enes Onuş - 08.06.2022 10:43

great video thanks

Ответить
Taco Cat
Taco Cat - 22.05.2022 10:49

Thanks for visuallizing this :)

Ответить
Owewi Wins!
Owewi Wins! - 05.05.2022 07:10

Wow, thanks GeeksforGeeks!

Ответить
tungstencube
tungstencube - 20.04.2022 02:26

If you're wondering why partition works:, this is sort of a proof that helped me understand

1) Fact: every element up to l is smaller than 70.
explanation: if an element was smaller than 70 we swapped it to the the value of l at the time. the l value was everything
between 0 and current l. (the main thing you have to understand, the rest comes from it)



2)Fact: There are exactly l+1 elements below 70
explanation: With J we went over every item in the array exactly once. every time an item below 70 was encountered we "l++ 'd" if an item below 70 was encountered

Conclusion 1 : Since every item at l or below is smaller than 70 and there are exactly l+1 items in those locations and l+1 items below 70.:
Every element at l or below is less than 70.
Conclusion2: Every item above l is more than 70. (immediate from conclusion 1)

Ответить
ANISH KUMAR GIRI
ANISH KUMAR GIRI - 19.04.2022 07:06

No Platform can ever compete geeksforgeeks

Ответить
Kirollos Eisa
Kirollos Eisa - 09.04.2022 03:27

3 awesome 👌 minutes
Keep going on 🤟

Ответить
Kirollos Eisa
Kirollos Eisa - 10.03.2022 04:51

Awesome ,thanks 👌

Ответить
Ömer Faruk Büyükbaş
Ömer Faruk Büyükbaş - 15.02.2022 00:56

everything is great in this video but the colour of background is just eye fckng 😵😵‍💫

Ответить
Ludovico Righi
Ludovico Righi - 13.02.2022 20:56

Song name?

Ответить
GAME ZONE
GAME ZONE - 02.02.2022 08:49

I have some douts:(

Ответить
Imran Abbasi
Imran Abbasi - 01.02.2022 09:16

Substandard video. Not satisfied

Ответить
NaingKhantHtet
NaingKhantHtet - 01.02.2022 07:14

GOAT!

Ответить
Ahmet Laçin
Ahmet Laçin - 27.01.2022 04:17

thank you million times

Ответить
geeky skill
geeky skill - 20.01.2022 13:52

i dont like this video becuse there are no calling recursivly to the function in diagram

Ответить
KNIGHTSPY GAMING
KNIGHTSPY GAMING - 22.10.2021 18:48

Swap function should be written before i++ (increment)

Ответить
Everything About Life
Everything About Life - 20.10.2021 09:18

Sorry but this is damn poor presentation about quick Sort Algorithm...

Ответить
sf
sf - 01.10.2021 23:12

after reading the related part in the Grokking Algorithms book, i have to admit the explanation in this video is absolute garbage.

Ответить
Chibi Max
Chibi Max - 20.09.2021 13:46

its confusing.....stopping the in he middle of it and moving on....!

Ответить
magenta ta
magenta ta - 03.09.2021 20:16

okka mukka ardam italed ra nayana

Ответить
Tanson Thomas
Tanson Thomas - 02.09.2021 03:32

This video is good for doing work out not for learning quick sort

Ответить
Rajan kumar
Rajan kumar - 27.08.2021 13:47

public class QucikSort {
static void Sort(int arr[],int low,int high) {
if(low>high) return;
int mid = low+(low+high)/2;
int pivot = arr[mid];
int i = low;
int j = high;
while(i<j) {
while(arr[i]<pivot) {i++;}
while (arr[j]>pivot) {j--;}
if(i<=j) {
int temp =arr[i];
arr[i]= arr[j];
arr[j]= temp;
i++;
j--;

}
}
if(low<j)
Sort(arr,low,j);
if(high>i)
Sort(arr,i,high);
}
public static void main(String args[]) {
int arr[] = {5,8,45,3,54,8,3,5,31,4,21,2,5,1}; //hardcode
System.out.print("Before quick sorting:");
for(int i=0;i<arr.length;i++) {
System.out.print(" " +arr[i]); //loop for printing array
}
System.out.println(); // print statement for printing it on nextline;
Sort(arr, 0, arr.length-1);
System.out.print("After quick sorting:");
for(int i=0;i<arr.length;i++) {
System.out.print(" "+arr[i]);////loop for printing array
}

}
}

sir iam getting stack overflow error plz help me stuck with my code
below is my error
Exception in thread "main" java.lang.StackOverflowError
at QucikSort.Sort(QucikSort.java:21)
at QucikSort.Sort(QucikSort.java:21)
at QucikSort.Sort(QucikSort.java:21)
at QucikSort.Sort(QucikSort.java:21)

Ответить
Bom Ky Su
Bom Ky Su - 04.08.2021 20:54

I don't know if this video follows quick sort or not,
but when I look at the quicksort flow chart, I created a faster one.

Ответить
Manab Saha
Manab Saha - 18.07.2021 13:35

These visuals by gfg makes life a lot easier.

Ответить
Lubna Boghara
Lubna Boghara - 14.07.2021 13:19

Please change the background colour

Ответить
Tareq Mahmud
Tareq Mahmud - 08.07.2021 11:22

this video to fast and the music ruins the mood to grasp, good video though

Ответить
曾玮
曾玮 - 01.07.2021 20:17

my Gosh. After 3 days of watching videos and trying myself finally I got how this code works.
This is the only video worth watching. Thank you so much.

Ответить
Supriyo Saha
Supriyo Saha - 12.06.2021 10:02

Good explanation under 3 mints, thanks

Ответить
Aarón Argotte López
Aarón Argotte López - 10.05.2021 22:39

Thanks

Ответить
Rahul
Rahul - 08.05.2021 11:11

Why have u included such sound it's an algorithm video not a DIY kind of stuffs🙂🙂

Ответить
Faysal Ahmed Akash
Faysal Ahmed Akash - 29.04.2021 05:24

please don't add music

Ответить
ND Quân
ND Quân - 21.04.2021 08:27

Thank u, i understood this algorithm.

Ответить
Diego D.
Diego D. - 02.04.2021 00:31

Had to watch this on mute

Ответить
SULTAN Ahmed
SULTAN Ahmed - 24.03.2021 08:10

The color.white.is.not appearing.on.light green

Ответить