(Compare element one by one)
Time taking
- Best Case = O(1)
- Average Case = O (n)
- Worst Case Complexity O(n)
Assume Find K = 41
Program
|
Binary seach :-( Worked with sorted Array)
हमारे पास elements (a+b/2) को Check किया जाता है और उसके हिसाब से Half parts को eleminate कर दिया जाता है और आगे के Parts को ऐसे ही तरीके से सर्च किया जाता है.
Selection sort :- Selection सिलेक्शन Sort में सबसे पहला सबसे छोटा आइटम सर्च किया जाता है और उस छोटे आइटम को swap कर दिया जाता है first एलिमेंट से इसी प्रकार से 2nd smallest element एलिमेंट फिर 3,4 so on. और ऐसे करके elements को सही पोजीशन पर लगाया जाता है
Step 0
Step 1
Step 2
Step 3
Program for Selection sort
Bubble sort :- swap to nex element. (link for example and programs )
Insertion sort :- select any element and sorted fully (sort like 2elemt . 3 elements >..)