Insertion Sort in Hindi – Sorting Algorithms In Hindi

Data Structure
Loading...

Insertion Sort in Hindi – Data Structures In HINDI – Iss Post Mein Hum Dekhenge Insertion Sort Ke Baare Mein Ki Ye Kis Kaam Mein Aati Hai, Isko Use Kaise Karte Hai Aur Ye Kis Tarah Se Useful Hoti Hai Sorting Karne Ke Liye.

Also Read – Introduction to Sorting And Bubble Sort

Insertion Sort in Hindi

Insertion Sort Ek Simple Sorting Algorithm Hai, Ye Algorithm Basically End Se Comparison ( playing cards in our hands ) Karke Elements ko Sort Karti Hai, Or Agar Elements Order Mein Naa Ho Toh Unko Swap Kar Dete Hai, Iska Example hum Aage Dekhenge

Example:

Humne Unsorted Data Liya Hai Example ke Liye, Isko Hum Insertion sort Ki Help Se Sort Karenge

Step 1 : Hum Pahle 1st Element (85) Ko Ye Man Lenge Ki Wo Element Sort Hai, And Baki Element Un Sort Hai |

Step 2 : Ab Hum Next One Elements Lenge Or Unko Compare Karenge i,e. 85 And 12, Yha Par 12 Smaller hai 85 Se Isliye Hum Dono Ko Swap Kar Denge or Hamara Data Aisa Ho Jaega.

Step 3 : Ab Hum Compare Karenge Agle 3rd Elements (59) ko Pichle 12 And 85 Se, Joki 59 Unsort Hai, Ab Sabse Pahle 59 Ko 85 Se Compare Karenge Joki Unsort Hai Ab 59 ko Swap Kar Denge Or Fir Check karenge 59 ko 12 se, Joki 59 Greater Hai 12 se, Isliye Hamara Data Ab Aesa Ho jayega |

Step 4 : Ab Hum Agle 4th Element (45) Ko Check Karenge i,e. 85 ,59 And 12 Se, Sabse Pahle 45 ko 85 Se Chack Karenge, Kyoki 45 Smaller Hai 85 se Isliye Swap Kar Denge, Fir 45 Ko 59 Se check karenge, Kyoki 45 Smaller Hai 59 Se Isliye Fir Swap Kar Denge, Fir Check Karenge 45 Ko 12 Se, To Yaha Par 45 Greater Hai, Isliye Iski Position 2nd Ho Jayegi Or Ab Data Aesa Ho Jayega |

Step 5 : Ab Hum Agle 5th Element (72) Ko Check Karenge i,e. 85 ,59,45 And 12 Se, Sabse Pahle 72 ko 85 Se Chack Karenge, Kyoki 72 Smaller Hai 85 se Isliye Swap Kar Denge, Fir 72 Ko 59 Se check karenge, Kyoki 72 Greater Hai 59 Se, Isliye Iski Position 4th Ho Jayegi Or Ab Data Aesa Ho Jayega |

Step 6 : Ab Hum Last Element (51) Ko Check Karenge i,e. 85 ,72,59,45 And 12 Se, Sabse Pahle 51 ko 85 Se Chack Karenge, Kyoki 51 Smaller Hai 85 se Isliye Swap Kar Denge, Fir 51 Ko 72 Se check karenge, Kyoki 51 Smaller Hai 72 Se Isliye Fir Swap Kar Denge, Fir Check Karenge 51 Ko 59 Se, Kyoki 51 Smaller Hai 59 Se Isliye Fir Swap Kar Denge, And Fir 51 Ko 45 Se Cheack Karenge ,To Yaha Par 51 Greater Hai, Isliye Iski Position 3rd Ho Jayegi Or Ab Data Aesa Ho Jayega |

Finally, Iteration Ko Execute Karke Humko Sorted Data Mil Jaega, Ye Algorithm Bahut Simple Hai Execute Karne Mein Lekin Iski Time Complexity Best Case Me Order Of N Hoti Hai, And Worst Case Me Order of N Square Hoti.

Aage Ke Posts Mein Hum, Bachi Hui Selection Sorting Algorithms Ko Padhenge Detail Mein Or Dekhenge Ki Vo Kaise Kaam Karti Hai, Kyuki Har Ek Algorithm Ki Execution Alag Hoti Hai

Leave a Reply

Your email address will not be published.