Insertion Sort- Proof of correctness using loop invariance

preview_player
Показать описание
In this video, we discuss the correctness of Insertion Sort and prove it using the concept of loop invariance.

If you want to obtain a certification and a Algorithms Foundations badge from the State University of New York Binghamton based on the videos in this channel, please visit the link. For obtaining the certification, you will need to pass a multiple choice final exam based on these videos. The course also contains self-assessment quizzes to help you prepare for the finals and for obtaining the certificate.

This channel is part of CSEdu4All, an educational initiative that aims to make computer science education accessible to all! We believe that everyone has the right to good education, and geographical and political boundaries should not be a barrier to obtaining knowledge and information. We hope that you will join and support us in this endeavor!

---------
Help us spread computer science knowledge to everyone around the world!

Please support the channel and CSEdu4All by hitting "LIKE" and the "SUBSCRIBE" button. Your support encourages us to create more accessible computer science educational content.

---------
Find more interesting courses and videos in our website

---------
Find and Connect with us on Social Media:

Рекомендации по теме
Комментарии
Автор

I've been reading the same exact words your explaining here on my book for the past hour and my mind was like ' I DON NOT GET IT MOVE ON PLEASSSE " and here I'm now fully understanding the whole concept of LI with the example on top .. thank you so much 🤍

blue-gogr
Автор

Thank you very much for making such a clear explanation of the loop invariant! This video has been extremely helpful!

Javier-ovhj
Автор

والله الواحد من غير اخواته الهنود معرفش كان هيعمل اية جمايلكم مغرقانة والله شكرا جدا 🫡

abdelrhmangamal
Автор

What you claim holds true while the internal while loop is correct, so would you need to prove the internal loop given the conditions of each loop for a sound proof?

colbymus
Автор

the loop invariant condition...is it going to be different for different algorithms ??? Here the condition was subarray A[1...j-1] consists of elements prriginally in A[1...j-1] but in sorted order. To porve loop invariant, do we consider this condition true for every algorithm ??

Cool.couple.channel
Автор

Why did u start from j=1? instead of 0th index or 1st index sir?
Pls respond sir i got an exam now shortly

Sidgo
Автор

how to proof correctness of this algorithm:
function increment(y)
comment Return y + 1, where y in N
x := 0; c:= 1; d:= 1;
while (y > 0) V (c > 0) do
a :=y mod 2;
if a XOR c then x=x+d;
c:= a AND c;
d:= 2d; y := [y/2] :
return(x)

jbipmni
Автор

Thank you very much, sir for a clear explanation please make more videos sir.

sMKUMARSAISKLM
Автор

Thank you very much sir. This was a clear explanation.

savindul.w.
join shbcf.ru