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

Add pt-BR translation to search/binary-search #664

Merged
merged 1 commit into from
Jan 27, 2022
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions src/algorithms/search/binary-search/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Binary Search

_Read this in other languages:_
[Português brasileiro](README.pt-BR.md).

In computer science, binary search, also known as half-interval
search, logarithmic search, or binary chop, is a search algorithm
that finds the position of a target value within a sorted
Expand Down
22 changes: 22 additions & 0 deletions src/algorithms/search/binary-search/README.pt-BR.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Busca Binária

_Leia isso em outras línguas:_
[english](README.md).

Em ciência da computação, busca binária, também conhecida como busca de meio-intervalo, busca logarítmica ou corte binário, é um algoritmo de pesquisa
que encontra a posição de um elemento alvo dentro de um
vetor ordenado. O algoritmo compara o elemento alvo com o elemento central do vetor; se eles são diferentes, a metade em que
o elemento alvo não pode estar é eliminada e a busca continua
na metade remanescente até que o elemento alvo seja encontrado. Se a busca
terminar com a metade remanescente vazia, o elemento alvo não está presente no vetor.

![Busca Binária](https://upload.wikimedia.org/wikipedia/commons/8/83/Binary_Search_Depiction.svg)

## Complexidade

**Complexidade de Tempo**: `O(log(n))` - pois a área de busca é dividida por dois a cada iteração.

## Referências

- [Wikipedia](https://en.wikipedia.org/wiki/Binary_search_algorithm)
- [YouTube](https://www.youtube.com/watch?v=P3YID7liBug&index=29&list=PLLXdhg_r2hKA7DPDsunoDZ-Z769jWn4R8)