Skip to content

Commit

Permalink
Add pt-BR translation to search/binary-search (trekhleb#664)
Browse files Browse the repository at this point in the history
  • Loading branch information
fveronezipeters committed Jan 27, 2022
1 parent ef50238 commit 8bd329d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
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)

0 comments on commit 8bd329d

Please sign in to comment.