Computer Science - 9210 OxfordAQA

Sorting Algorithms

Übersicht

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.

Ziele

  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.

Mindmap

Dieses Thema ist als Karte dargestellt, damit die Zusammenhange sichtbar werden.

Mindmap in der App offnen

Lektionshinweis

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.

Vollstaendige Lernnotiz in der Green Bridge App

Holen Sie sich die Green Bridge CBT App auf Handy oder Computer fuer die komplette IGCSE-Bibliothek: fruehere Pruefungen, Bewertungsschemata, Mindmaps, Lernkarten und Audiolektionen.

Vollständige Lernnotizen mit Diagrammen
KI-gestützter Lernassistent
Pruefungssimulationen auf Zeit, sofort nach Abgabe bewertet
Verfügbar für Android, Windows, macOS und Linux iOS-App demnachst verfugbar

Unterrichtsbewertung

Herzlichen Glückwunsch zum Abschluss der Lektion über Sorting Algorithms. Jetzt, da Sie die wichtigsten Konzepte und Ideen erkundet haben,

Sie werden auf eine Mischung verschiedener Fragetypen stoßen, darunter Multiple-Choice-Fragen, Kurzantwortfragen und Aufsatzfragen. Jede Frage ist sorgfältig ausgearbeitet, um verschiedene Aspekte Ihres Wissens und Ihrer kritischen Denkfähigkeiten zu bewerten.

Nutzen Sie diesen Bewertungsteil als Gelegenheit, Ihr Verständnis des Themas zu festigen und Bereiche zu identifizieren, in denen Sie möglicherweise zusätzlichen Lernbedarf haben.

  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

Bearbeiten Sie diese Fragen in der App

Bearbeiten Sie diese Fragen in der App

Übungsklausuren üben

Möchten Sie Übungsklausuren zu Sorting Algorithms üben? Laden Sie die Green Bridge CBT App herunter, um Übungsklausuren und vollständige Prüfungssimulationen zu diesem Thema zu erhalten.

Lade die App im Google Playstore herunter.

Alles, was du brauchst, um in JAMB, WAEC & NECO zu glänzen.

Green Bridge CBT Mobile App
Personalisierter KI-Lern-Chat-Assistent
Über 200.000 Prüfungsfragen für IGCSE, JAMB, WAEC und NECO.
Über 1200 Unterrichtsnotizen
Offline-Unterstützung - Lernen jederzeit und überall
Fahrplan der Grünen Brücke
Literaturzusammenfassungen & Potenzielle Fragen
Verfolgen Sie Ihre Leistung und Ihren Fortschritt
Detaillierte Erklärungen für umfassendes Lernen