Selection sort in Data Structure in Hindi (selection sort क्या है जाने हिंदी में…. )

Hello दोस्तों! आज हम इस पोस्ट में What is Selection sort in Hindi के बारें में पूरे विस्तार से पढेंगे और इसके उदाहरण को भी देखेंगे तो चलिए start करते हैं:-


What is Selection sort in Hindi:-

ये technique minimum-maximum element पर निर्भर करती है।

इसके लिए सबसे पहले minimum value को select किया जायेगा ।

और उसे arrayकी first position पर रख दिया जाता है ।

उसके बाद 2 nd minimum element को find करेंगे और उससे 2nd position से exchange कर दिया जायेगा।

Pass1: Find the location LOC of the smallest in the list of elements

A[1], A[2],….,A[N], and then interchange A[LOC] and A[1]. Then:

Pass2:- Find the location LOC of the smallest in the sublist of N – 1 element

A [2], A [3],…, A[N], and then interchange A[LOC] and A[2]. Then:

A [1], A[2] is sorted, since A[1] < A[2].

Pass3:- Find the location LOC of the smallest in the sublist of N – 2 elements

A [3], A [4],…, A[N], and then interchange A[LOC] and A[3]. Then:

A[1], A[2],…., A[3] is sorted, since A[2] < A[3].

……………………………………………………………………………………………………………………………

……………………………………………………………………………………………………………………………

Pass N – 1 Find the location LOC of the smaller of the elements A[N-1], A[N], and

Then interchange A [LOC]

Thus A is sorted after N – 1 pass.

Example:

Selection sort को समझने के लिए निम्न method को use मे लेते है

निम्न array दिया गया है

77 33 44 11 88 22 66 55


इस array को sort करने के लिए निम्न steps को follow करेंगे ।

1 सबसे पहले array के minimum element को find out करेंगे

2 array का minimum element 11 है इसे array के 0 index से replace कर दिया जायेगा।

3 अब a[1] से a[7] तक मे से minimum element को find out करेंगे। minimum element 22 है उसे a[1] से replace कर दिया जायेगा ।

4 अब a[2] से a[7] तक के minimum element को find out करेंगे । minimum element 33 है इसे a[3] से replace कर दिया जायेगा ।

5 अब a[3] से a[7] तक के minimum element को find out करेंगे minimum element 44 है इसे a[3] से replace कर दिया जायेगा ।

6 अब a[4] से a[7] तक के minimum element को find out करेंगे minimum element 55 है इसे a[4] से replace कर दिया जायेगा ।

7 अब a[5] से a[7] तक के element को find out करेंगे minimum element 66 है इसे a[5] से replace कर दिया जायेगा ।

8 अब a[6] से a[7] तक के minimum element 77 है यह अपनी स्थान पर ही है अतः इसे sort करने की आवश्यकता नहीं है ।

Algorithm of selection sort:-

यह algorithm आसानी से प्रारम्भ की जा सकती है  जैसे

  1. Repeat steps 2 and 3 for k=1, 2 ………………… n-1:
  2. Call (a,k,n,loc).
  3. [Interchange a[k])and a(loc)]

Set temp : a (k) a (k) : = a (loc) and a (loc) : = temp.

[End of step 1 loop]

  1. Exit.

निवेदन:- आशा करता हूँ कि यह आर्टिकल आपके लिए उपयोगी रहा होगा, अगर आपको ऐसे ही और articles चाहिए तो नीचे comment करके अवश्य बताइए और हाँ इस पोस्ट को अपने दोस्तों और classmates के साथ अवश्य share कीजिये. Thanks.


इसे भी देखे:

Hello दोस्तों! नीचे दिए गए links पर click  करके आपको हम  इस पोस्ट में  (Computer Online Test) की Practice कराएंगे जिससे आप अपने  CCC, O level , कम्प्युटर GK की practice कर सकते है.

इस post के द्वारा आप  अपनी कम्प्युटर की  नॉलेज बड़ सकते है.

उसके साथ ही साथ आप अपने कई प्रकार के पेपरो की भी तैयरी  भी कर सकते है.

जैसे की CCC, O level , कम्प्युटर GK की practice कर सकते है,

Leave a Comment