Computer Science - 9210 OxfordAQA

Sorting Algorithms

Visão Geral

Hand a shuffled pack of cards to two people and tell them both to put it in order. One of them goes through the pack again and again, swapping any neighbouring pair that is the wrong way round, until a whole pass produces no swaps at all. The other splits the pack in half, gives half to a friend, and when the two sorted halves come back merges them by repeatedly taking whichever of the two top cards is lower. Both finish with a sorted pack. On fifty-two cards they finish at about the same time. On fifty-two thousand they do not.

Those are the bubble sort and the merge sort, and this specification asks for something different from each. For the bubble sort you must know one specific version, with two nested loops, and be able to follow and write pseudocode for it. For the merge sort you must be able to explain it in prose and demonstrate it on a given set of data, and you will not be asked to write pseudocode for it. Then you must compare and contrast the two. Knowing which of those three demands applies to which algorithm saves you from revising the wrong thing.

Objetivos

  1. Understand and explain how the merge sort algorithm works.
  2. Understand and explain how the bubble sort algorithm works.
  3. Compare and contrast merge sort and bubble sort algorithms.

Mapa mental

Este tema esta mapeado para mostrar como as ideias se ligam.

Abra o mapa mental na aplicacao

Nota de Aula

Sorting is the most-run family of algorithms in computing, and the reason is not that people like tidy lists. Sorted data unlocks other algorithms. A binary search is only possible on a sorted array. Finding duplicates in a sorted list takes one walk instead of comparing everything with everything. Merging two sorted lists into one sorted list takes a single pass. Sorting once buys speed on every operation that follows, which is why a database will spend real time keeping an index in order.

Apontamento completo disponivel na aplicacao Green Bridge

Instale a aplicacao Green Bridge CBT no telemovel ou computador para aceder a biblioteca IGCSE completa: exames anteriores, criterios de correcao, mapas mentais, cartoes de estudo e licoes em audio.

Notas de aula completas com diagramas
Assistente de aprendizagem com IA
Simulacros cronometrados corrigidos assim que termina
Disponível para Android, Windows, macOS e Linux Aplicacao iOS em breve

Avaliação da Lição

Parabéns por concluir a lição em Sorting Algorithms. Agora que você explorou o conceitos e ideias-chave, é hora de colocar seu conhecimento à prova. Esta seção oferece uma variedade de práticas perguntas destinadas a reforçar sua compreensão e ajudá-lo a avaliar sua compreensão do material.

Irá encontrar uma mistura de tipos de perguntas, incluindo perguntas de escolha múltipla, perguntas de resposta curta e perguntas de redação. Cada pergunta é cuidadosamente elaborada para avaliar diferentes aspetos do seu conhecimento e competências de pensamento crítico.

Use esta secção de avaliação como uma oportunidade para reforçar a tua compreensão do tema e identificar quaisquer áreas onde possas precisar de estudo adicional. Não te deixes desencorajar pelos desafios que encontrares; em vez disso, vê-os como oportunidades de crescimento e melhoria.

  1. In the version of the bubble sort required by this specification, what controls the outer loop? A. A count of the number of items B. A count of the number of swaps made C. Whether any swaps were made during the previous pass D. Whether the first element is smaller than the last Answer: C
  2. An array of 6 items is already in ascending order. How many passes does the bubble sort make? A. 1 B. 5 C. 6 D. 15 Answer: A
  3. Which statement about the merge sort is correct? A. It compares each element with the one next to it B. It splits the list in half repeatedly and then merges the sorted pieces C. It only works on data that is already partly sorted D. It sorts in place without needing any extra memory Answer: B
  4. Two sorted lists, 2, 5, 9 and 3, 4, are merged. Which value is taken third? A. 2 B. 3 C. 4 D. 5 Answer: C
  5. Which of these is an advantage of the bubble sort over the merge sort? A. It is much faster on very large lists B. Its performance does not depend on the starting order C. It detects an already sorted list in a single pass D. It can sort lists that do not fit in memory Answer: C

Resolva estas questoes na aplicacao

Resolva estas questoes na aplicacao

Pratique Questões Simuladas

Quer praticar questões simuladas sobre Sorting Algorithms? Descarregue a aplicação Green Bridge CBT para aceder a questões simuladas e avaliações completas sobre este tópico.

Descarregar a aplicação na Google Play Store

Tudo o que precisas para te destacares no JAMB, WAEC e NECO.

Green Bridge CBT Mobile App
Assistente de Chat de Aprendizagem Personalizada com IA
Mais de 200.000 questões de exame do IGCSE, JAMB, WAEC e NECO
Mais de 1200 Notas de Aula
Suporte Offline - Aprenda a Qualquer Hora, em Qualquer Lugar
Horário da Ponte Verde
Resumos de Literatura & Possíveis Perguntas
Acompanhe o Seu Desempenho e Progresso
Explicações Detalhadas para uma Aprendizagem Abrangente