O GoConqr está de visual novo! Conte para nós o que você achou.

Flashcards

Searching Algorithm Flashcards

Dylan Burchell Inglês 10 flashcards

Flashcards do conjunto (10)

  1. 1Linear SearchA searching algorithm that will address each individual element in an array until it has searched every element or locates the desired one.
  2. 2Binary SearchA searching algorithm that will search for the middle value of an array and recognize if the element it is searching for is greater or lesser than the middle. It will continue to divide and search until it eventually finds the desired element.
  3. 3Disadvantages of Linear Searches* Will take a greater amount of time to locate the desired item, making it inefficient in most cases compared to Binary Searches.
  4. 4Disadvantages of Binary Searches* Are more complex compared to Linear Searches, which may make them confusing to some.
    * Binary Searches can only operate on ordered lists, which reduces their effectiveness compared to Linear Searches, which can operate on any list.
  5. 5Advantages of Linear Searches* Linear Searches are useful for small lists, as there would be few values to search through.
    * Linear Searches do not need to be ordered to locate an item, therefore making them more versatile when searching compared to Binary Searches.
  6. 6Advantages of Binary Searches* Binary Searches can operate very efficiently, reducing large lists down very quickly using the divide and conquer method, meaning they will have a shorter runtime.
  7. 7" [ 1, 2, 3, 4 ] - Find 3. " Which algorithm would be best?The Linear Search would be best for this list, as there are very few values, meaning locating item 3 wouldn't require a Binary Search.
  8. 8" [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 ] - Find 12. " Which algorithm would be best?The Binary Search would be the most suitable, as the list is sorted in ascending order, and it contains a great amount of items - meaning it can divide and conquer to locate the desired item, rather than search through every one like a Linear Search would have.
  9. 9" [ 1, 3, 2, 6, 4, 11, 9 ] - Find 3. " Which algorithm would be best?Despite its slightly lengthier appearance, the Linear Search would be the most suitable, as the list hasn't been sorted - making the Binary Search redundant under these circumstances. It would require the method of searching each individual item to locate the desired one as the divide and conquer method used by the Binary Search would not work.
  10. 10Divide and ConquerDivide and Conquer is the method used by Binary Searches. It will find the middle value of a list, then search if the desired item is greater or lesser than the middle item. If it is greater, then the lesser values (including the middle) will be ignored, and the middle value of the new, shorter list will be investigated, until the desired value is found. The same process will be carried out if the value is lesser, with the greater values being ignored instead.

Informações

Descrição
FlashCards sobre Searching Algorithm Flashcards, criado por Dylan Burchell em 01-12-2022.
Criado por
Dylan Burchell · dez 2022
Atualizado
1 dez 2022
Visualizações
2
Avaliação

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?