Lec-50: Quick Sort in Python 🐍 with Code | DSA in Python 🐍

preview_player
Показать описание
00:00 – Quick sort
01:00 – algorithm with example

In this video, Quick sort is a popular sorting algorithm based on the divide-and-conquer strategy. It works by selecting a pivot element from the array and partitioning the other elements into two sub-arrays according to whether they are less than or greater than the pivot. The sub-arrays are then recursively sorted.

► Python For Beginners(Complete Playlist):

Other Subject-wise Playlist Links:
--------------------------------------------------------------------------------------------------------------------------------------
►Computer Networks :
►Design and Analysis of algorithms (DAA):
►Database Management System:
► Theory of Computation
►Artificial Intelligence:
►Computer Architecture:
►Operating System:
►Structured Query Language (SQL):
►Discrete Mathematics:
►Compiler Design:
►Number System:
►Cloud Computing & BIG Data:
►Software Engineering:
►Data Structure:
►Graph Theory:
►Programming in C:
►Digital Logic:
► Class XI Computer Science(Full Syllabus)
► Microprocessor Playlist:

---------------------------------------------------------------------------------------------------------------------------------------
Our social media Links:
--------------------------------------------------------------------------------------------------------------------------------------
►For Any Query, Suggestion or notes contribution:
Рекомендации по теме
Комментарии
Автор

def partition(L, lower, upper):
# Select first element as a pivot
pivot = L[lower]
i = lower
for j in range(lower+1, upper+1):
if L[j] <= pivot:
i += 1
L[i], L[j] = L[j], L[i]
L[lower], L[i]= L[i], L[lower]
# Return the position of pivot
return i

def quicksort(L, lower, upper):
if(lower < upper):
pivot_pos = partition(L, lower, upper);
# Call the quick sort on leftside part of pivot
quicksort(L, lower, pivot_pos-1)
# Call the quick sort on rightside part of pivot
quicksort(L, pivot_pos+1, upper)
return L

SAYANTANDEY-lhty
Автор

Sir CS valo ke liye bhi content upload kijiye please meri bahut help ho jayegi. Aap bahut acche se samjhate hai. Sab kuch ek baar mein hi samaj aa jata hai isliye bol rahe . Please sir content upload kijiye CS valo ke liye bhi to mera bhi exam sayad clear ho jaye ek hi baar mein. Please sir

BhajanDuniya
Автор

Verify the truth table for the three input exclusive or gate, List all 8 combinations of x, y, z. Evaluate A =x oplus y, then evaluate F =A oplus z=x oplus v oplus z

Sir please discuss this question 😢😢😢😢😢😢😢

wellknowledgebyayushi
Автор

sir can u show the implimentation of this code its getting error at partation part

zacksid
Автор

Sir plx merge sort or heap sort b krayo plz

parisharma
Автор

Hi i am from pakistan . I am a student of PU i like your lectures but i need your help in
DLD subjects plz make a vedio in which you cover all type of questions which is important for exams point of you

HareemTahir-cq
Автор

Exam time = your videos + 2x speed = 100% doubt clear + good marks + understanding + knowledge
You are the real hero for comp science& engineering students ❤ thank you for doing this for us

Funnyfacts
Автор

m getting time limit exceeded while working with larger is that

sharonsajan
Автор

Sir very good video. You explain every topic EZ PZ.

gigaheheboi
Автор

Sir quick sort mein low+high/2 se pivot mil sakta Hai ne

DhruviPatel-ezil
Автор

Data structure ki book mein aesa hi bataya gya Hai....

DhruviPatel-ezil
Автор

Sir your videos clear all my doubts ..also make videos on daa (desing & analysis algo)in python

Funnyfacts
Автор

Under Quick_sort() function, a 'return arr' line code added then it don't show error

rwdybiswajit
join shbcf.ru