SóProvas


ID
192928
Banca
FCC
Órgão
MPE-RN
Ano
2010
Provas
Disciplina
Algoritmos e Estrutura de Dados
Assuntos

São métodos (algoritmos) de busca em cadeias

Alternativas
Comentários
  • Resposta: Letra A: Boyer-Moore e Knuth-Morris-Pratt.

    Dica de livro completo sobre algoritmos:  http://www.gladsonroberto.com.br/posts/Algoritmos_teoria_e_Pratica.pdf

    Na página 730 tem algumas informações sobre Knuth-Morris-Pratt.

  • O algoritmo de Knuth–Morris–Pratt procura a ocorrência de uma "palavra" W dentro de uma "string de texto" S empregando a simples técnica de que quando aparece uma diferença, a palavra tem em si a informação necessária para determinar onde começar a próxima comparação.

    The Boyer–Moore string search algorithm is a particularly efficient string searching algorithm, and it has been the standard benchmark for the practical string search literature.[1] It was developed by Bob Boyer and J Strother Moore in 1977. The algorithm preprocesses the target string (key) that is being searched for, but not the string being searched in (unlike some algorithms that preprocess the string to be searched and can then amortize the expense of the preprocessing by searching repeatedly). The execution time of the Boyer-Moore algorithm can be sub-linear: it doesn't need to check every character of the string to be searched, but rather skips over some of them. Generally the algorithm gets faster as the key being searched for becomes longer. Its efficiency derives from the fact that with each unsuccessful attempt to find a match between the search string and the text it's searching, it uses the information gained from that attempt to rule out as many positions of the text as possible where the string cannot match.