diff --git a/_content/tour/swa/algorithms-searches.article b/_content/tour/swa/algorithms-searches.article index 4b7f3b53..1cc287b1 100644 --- a/_content/tour/swa/algorithms-searches.article +++ b/_content/tour/swa/algorithms-searches.article @@ -1,42 +1,40 @@ -Search Operations -This section provides examples that perform search operations. +Oparesheni za utafutaji +Sehemu hii hutoa mifano ambayo hufanya oparesheni za utafutaji. -* Binary Search +* Utafutaji wa binary. -- [[https://www.ardanlabs.com/training/individual-on-demand/ultimate-go-bundle/][Watch The Video]] -- Need Financial Assistance, Use Our [[https://www.ardanlabs.com/scholarship/][Scholarship Form]] +- [[https://www.ardanlabs.com/training/individual-on-demand/ultimate-go-bundle/][Tazama video]] +- Ukihitaji usaidizi wa udhamini, tumia tuvuti [[https://www.ardanlabs.com/scholarship/][Fomu ya udhamini]] -The sample program implements a function that performs an iterative -binary search against set of integers. +Programu ya sampuli hutumia kazi ambayo hufanya iterative utaftaji wa binary dhidi ya seti ya nambari. -- See more at [[https://en.wikipedia.org/wiki/Binary_search_algorithm][https://en.wikipedia.org/wiki/Binary_search_algorithm]] +- Mengi kwenye [[https://en.wikipedia.org/wiki/Binary_search_algorithm][https://en.wikipedia.org/wiki/Binary_search_algorithm]] -*Diagram* +*Mchoro* - Binary search compares the target value to the middle element of the - array. If they are not equal, the half in which the target cannot lie - is eliminated and the search continues on the remaining half, again - taking the middle element to compare to the target value, and repeating - this until the target value is found. If the search ends with the - remaining half being empty, the target is not in the array + Utaftaji wa binary unalinganisha thamani ya lengo kwa sehemu ya kati ya + safu. Ikiwa sio sawa, nusu ambayo lengo haliwezi kusema uwongo + huondolewa na utaftaji unaendelea kwenye nusu iliyobaki, tena + kuchukua kipengee cha kati kulinganisha na thamani ya lengo, na kurudia + hii hadi thamani ya lengo ipatikane. Ikiwa utaftaji unamalizika na + nusu iliyobaki kuwa tupu, lengo sio katika safu. ┌────┐ - │ 83 │ ◁── Target Number + │ 83 │ ◁── Nambari ya lengo └────┘ ┌────┐┌────┐┌────┐┌────┐┌────┐ - │ 04 ││ 42 ││ 80 ││ 83 ││ 95 │ ◁── Starting Array + │ 04 ││ 42 ││ 80 ││ 83 ││ 95 │ ◁── Safu ya kuanza └────┘└────┘└────┘└────┘└────┘ - ┌────┐ ◁── Middle Value - │ 80 │ ◁── Target Number Is Greater + │ 80 │ ◁── Idadi ya nambari ya lengo ni kubwa └────┘ ┌────┐┌────┐ - │ 83 ││ 95 │ ◁── Search This Half + │ 83 ││ 95 │ ◁── Tafuta nusu hili └────┘└────┘ ┌────┐ - │ 83 │ ◁── Middle Value + │ 83 │ ◁── Thamani ya katikati └────┘ ┌────┐ - │ 83 │ ◁── Target Found / Idx 3 + │ 83 │ ◁── Lengo inapatikana / Idx 3 └────┘ .play algorithms/searches/binary_iterative.go