Computer Science - 9210 OxfordAQA

Sorting Algorithms

Resumen

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 esquematizado para ver como se conectan las ideas.

Abre el mapa mental en la app

Nota de la lección

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.

Apunte completo disponible en la aplicacion Green Bridge

Instala la aplicacion Green Bridge CBT en tu movil u ordenador para acceder a toda la biblioteca IGCSE: examenes anteriores, criterios de correccion, mapas mentales, tarjetas de estudio y lecciones en audio.

Notas de lección completas con diagramas
Asistente de aprendizaje con IA
Simulacros cronometrados que se corrigen en cuanto terminas
Disponible en Android, Windows, macOS y Linux App para iOS proximamente

Evaluación de la lección

Felicitaciones por completar la lección del Sorting Algorithms. Ahora que has explorado el conceptos e ideas clave, es hora de poner a prueba tus conocimientos. Esta sección ofrece una variedad de prácticas Preguntas diseñadas para reforzar su comprensión y ayudarle a evaluar su comprensión del material.

Te encontrarás con una variedad de tipos de preguntas, incluyendo preguntas de opción múltiple, preguntas de respuesta corta y preguntas de ensayo. Cada pregunta está cuidadosamente diseñada para evaluar diferentes aspectos de tu conocimiento y habilidades de pensamiento crítico.

Utiliza esta sección de evaluación como una oportunidad para reforzar tu comprensión del tema e identificar cualquier área en la que puedas necesitar un estudio adicional. No te desanimes por los desafíos que encuentres; en su lugar, míralos como oportunidades para el crecimiento y la mejora.

  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

Resuelve estas preguntas en la aplicacion

Resuelve estas preguntas en la aplicacion

Practica preguntas simuladas

¿Quieres practicar preguntas simuladas sobre Sorting Algorithms? Descarga la aplicación Green Bridge CBT para acceder a preguntas simuladas y evaluaciones completas sobre este tema.

Descarga la aplicación en Google Playstore.

Todo lo que necesitas para destacar en JAMB, WAEC y NECO.

Green Bridge CBT Mobile App
Asistente de Chat de Aprendizaje Personalizado con IA
Más de 200.000 preguntas de examen de IGCSE, JAMB, WAEC y NECO.
Más de 1200 notas de lecciones
Soporte sin conexión: Aprende en cualquier momento y lugar.
Horario del Puente Verde
Resúmenes de Literatura y Preguntas Potenciales
Controla tu rendimiento y progreso.
Explicaciones detalladas para un aprendizaje integral