Quick Sort Algorithm Explained and Implemented with Examples in Java | Sorting Algorithms | Geekific

  Рет қаралды 5,118

Geekific

Geekific

Күн бұрын

Пікірлер: 13
@trannhanITSinhVien
@trannhanITSinhVien 3 ай бұрын
I think we have a simpler way for partition of an array: arr[] 1. Choose a pivot: p 2. Use two cursors L (left) that is the first index of array and R (right) is the last index. 3. Rule: while L = p (loop until we find an element that is less than pivot) 3.3. If L < R: swap(arr[L], arr[R]) 4. Return L (partition point) Then we call quickSort(arr, begin, mid - 1) and quickSort(arr, mid, end). With "begin" is the first index of array, "end" is the last index, "mid" = partition point.
@MineCrafterCity
@MineCrafterCity 11 ай бұрын
I think this is isn't fully correct. You need to have a pivot and a "i" and "j" and you compare those with the pivot.
@geekific
@geekific 11 ай бұрын
Half of the video was dedicated to implement the method that plays around with the pivot. Check again!
@FluteVJ
@FluteVJ Жыл бұрын
Fantastic explanation. To improvise the performance we can avoid the swapping for the pivotIndexCounter == i. At 6:42 inside the if condition you can add the below code to do that. if(pivotIndexCounter==i) { pivotIndexCounter++; continue; }
@santhoshkumar1278
@santhoshkumar1278 Жыл бұрын
Thanks for this video. The explanations for the partition call stack was really helpful in understanding the algorithm better.
@Real_Dk
@Real_Dk 2 жыл бұрын
Excellent
@geekific
@geekific 2 жыл бұрын
Glad you liked it :)
@tioluwani6928
@tioluwani6928 Жыл бұрын
Thank you 🙏
@jeffreyadams1234
@jeffreyadams1234 2 жыл бұрын
Great content
@jeffreyadams1234
@jeffreyadams1234 2 жыл бұрын
Excellent
@geekific
@geekific 2 жыл бұрын
Thank you! Cheers!
@svalyavasvalyava9867
@svalyavasvalyava9867 2 жыл бұрын
Thank you!
@geekific
@geekific 2 жыл бұрын
My pleasure :)
小天使和小丑太会演了!#小丑#天使#家庭#搞笑
00:25
家庭搞笑日记
Рет қаралды 26 МЛН
Brawl Stars Edit😈📕
00:15
Kan Andrey
Рет қаралды 58 МЛН
when you have plan B 😂
00:11
Andrey Grechka
Рет қаралды 67 МЛН
Quicksort In Python Explained (With Example And Code)
14:13
FelixTechTips
Рет қаралды 148 М.
Quicksort Sort Algorithm in Java - Full Tutorial With Source
24:58
Coding with John
Рет қаралды 242 М.
Quick Sort Using Recursion (Theory + Complexity + Code)
42:14
Kunal Kushwaha
Рет қаралды 179 М.
Merge Sort Algorithm in Java - Full Tutorial with Source
23:02
Coding with John
Рет қаралды 178 М.
Learn Quick Sort in 13 minutes ⚡
13:49
Bro Code
Рет қаралды 344 М.
小天使和小丑太会演了!#小丑#天使#家庭#搞笑
00:25
家庭搞笑日记
Рет қаралды 26 МЛН