Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Translation] [Swahili] : translated algorithm search article #119

Open
wants to merge 1 commit into
base: swahili
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 20 additions & 22 deletions _content/tour/swa/algorithms-searches.article
Original file line number Diff line number Diff line change
@@ -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
Expand Down