Programmierprojekt Sortierverfahren
parent
c24fe5cb8b
commit
b35d699056
|
|
@ -0,0 +1,131 @@
|
|||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "cd29a032-072b-4ca6-a3e3-efb176993768",
|
||||
"metadata": {
|
||||
"editable": false,
|
||||
"slideshow": {
|
||||
"slide_type": ""
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"source": [
|
||||
"# Projekt zu Sortierverfahren"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "40d22d02-7d98-41f9-a5c0-d43a372e50a8",
|
||||
"metadata": {
|
||||
"editable": false,
|
||||
"slideshow": {
|
||||
"slide_type": ""
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"source": [
|
||||
"## Ziel\n",
|
||||
"Ziel ist es, verschiedene Sortierverfahren zu implementieren und zu vergleichen"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "e584a65a-a138-4064-85f2-f3fa468cf0ac",
|
||||
"metadata": {
|
||||
"slideshow": {
|
||||
"slide_type": ""
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"source": [
|
||||
"## 1. Allgemeine Kriterien\n",
|
||||
"* Auch zu Hause kann und soll weitergearbeitet werden!\n",
|
||||
"* Jedes Sortierverfahren soll in ein eigenes Jupyter-Notebook programmiert werden - eine Vorlage steht dafür bereit.\n",
|
||||
"* Die Funktion, um ein Array mit Zufallszahlen zu erzeugen, kann von Aufgabe 01.06.3 übernommen werden und muss dann in jedes Jupyter-Notebook kopiert werden.\n",
|
||||
"* Beginn ist am Montag, 24.11. Abgabe ist am Freitag, 12.12.\n",
|
||||
"* Am Montag, 8.12. findet die Klausur statt."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "1e385fe9-3054-41a9-9eda-192d0468cb0e",
|
||||
"metadata": {
|
||||
"editable": false,
|
||||
"slideshow": {
|
||||
"slide_type": ""
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"source": [
|
||||
"## 2. **MUSS**-Kriterien\n",
|
||||
"Die *MUSS*-Kriterien müssen auf jeden Fall erfüllt werden. Werden nur diese erfüllt, so liegt die Endnote im Bereich von ca. 6 Punkten.\n",
|
||||
"* Das Sortierverfahren **SelectionSort** muss sowohl **out-of-place** als auch **in-place** programmiert werden.\n",
|
||||
" * Hinweis: bei in-place dürfen keine Array-Funktionen wie z.B. `splice` oder `push` verwendet werden!\n",
|
||||
"* Das Sortierverfahren **InsertionSort** muss programmiert werden.\n",
|
||||
"* Der Quellcode muss **kurz kommentiert** werden.\n",
|
||||
" * Es soll nicht jede Zeile kommentiert werden, lediglich Blöcke, was ihr euch dabei gedacht habt und was der jeweilige Abschnitt tut."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "5642f602-be4b-417d-b993-fdf81e1ae37f",
|
||||
"metadata": {
|
||||
"editable": false,
|
||||
"slideshow": {
|
||||
"slide_type": ""
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"source": [
|
||||
"## 3. **SOLL**-Kriterien\n",
|
||||
"Werden zusätzlich auch noch die SOLL-Kriterien erfüllt, so liegt die Endnote bei ca. 10 Punkten.\n",
|
||||
"* Als Beispiel für die \"divide-and-conquer\"-Technik soll **MergeSort** programmiert werden.\n",
|
||||
"* **BubbleSort** soll programmiert werden.\n",
|
||||
"* Es soll eine Zeitmessung programmiert werden, um die Schnelligkeit der verschiedenen Sortierverfahren miteinander vergleichen zu können.\n",
|
||||
" * Achtung: die Zeitmessung nur für den Sortiervorgang **ohne** Ausgabe\n",
|
||||
"* Die *durchschnittlich* benötigte Zeit soll für **alle** Sortierverfahren für unterschiedlich große Arrays gemessen und zusammengestellt/verglichen werden."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "aca2c026-0d46-44ee-b177-65450ba74f89",
|
||||
"metadata": {
|
||||
"editable": false,
|
||||
"slideshow": {
|
||||
"slide_type": ""
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"source": [
|
||||
"## 4. **DARF**-Kriterien\n",
|
||||
"Werden **alle** Kriterien erfüllt, so liegt die Endnote bei etwa 15 Punkten.\n",
|
||||
"* Mindestens **zwei** der folgenden Algorithmen dürfen programmiert werden:\n",
|
||||
" * **HeapSort**\n",
|
||||
" * **QuickSort**\n",
|
||||
" * **TimSort**\n",
|
||||
" * oder ein selbst gewählter Sortieralgorithmus.\n",
|
||||
"* Begründe für **alle** Algorithmen, ob diese in *deiner* Programmierung stabil oder nicht-stabil funktionieren.\n",
|
||||
"* Gib die Laufzeit deiner Programmierung für alle Algorithmen an."
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Deno",
|
||||
"language": "typescript",
|
||||
"name": "deno"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": "typescript",
|
||||
"file_extension": ".ts",
|
||||
"mimetype": "text/x.typescript",
|
||||
"name": "typescript",
|
||||
"nbconvert_exporter": "script",
|
||||
"pygments_lexer": "typescript",
|
||||
"version": "5.8.3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 5
|
||||
}
|
||||
|
|
@ -0,0 +1,260 @@
|
|||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "7aa14816-da13-4292-bf98-e599bb4d57e3",
|
||||
"metadata": {
|
||||
"editable": false,
|
||||
"slideshow": {
|
||||
"slide_type": ""
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"source": [
|
||||
"# Programmierung für den Algorithmus:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "raw",
|
||||
"id": "6889ffe7-f0a7-4371-9edd-636d9da7396d",
|
||||
"metadata": {
|
||||
"editable": true,
|
||||
"raw_mimetype": "",
|
||||
"slideshow": {
|
||||
"slide_type": ""
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"source": []
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "25eeadb9-b28c-438d-942e-179c19f05c7d",
|
||||
"metadata": {
|
||||
"editable": false,
|
||||
"slideshow": {
|
||||
"slide_type": ""
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"source": [
|
||||
"## Funktion `zufallsArray`\n",
|
||||
"(einmal programmieren, in jedes Notebook kopieren)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "99f4d96d-9879-41b2-a3e2-4ac9518a0343",
|
||||
"metadata": {
|
||||
"editable": true,
|
||||
"slideshow": {
|
||||
"slide_type": ""
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"// erzeugt ein Array mit \"laenge\" zufälligen Zahlen\n",
|
||||
"function zufallsArray(laenge) {\n",
|
||||
"}"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "b761b72c-639c-4b0b-9aeb-b290897e2ead",
|
||||
"metadata": {
|
||||
"editable": false,
|
||||
"slideshow": {
|
||||
"slide_type": ""
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"source": [
|
||||
"## Funktion `sort`\n",
|
||||
"Die Funktion bekommt als Parameter ein unsortiertes Array und soll mithilfe des gewählten Sortier-Algorithmus das Array sortieren und zurückgeben."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "2272d5d1-f899-4e34-beb0-dfd86b87e349",
|
||||
"metadata": {
|
||||
"editable": true,
|
||||
"slideshow": {
|
||||
"slide_type": ""
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"function sort(arr) {\n",
|
||||
"}"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "a8afd5a3-09f5-41f4-af6c-8b155a402ba1",
|
||||
"metadata": {
|
||||
"editable": false,
|
||||
"slideshow": {
|
||||
"slide_type": ""
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"source": [
|
||||
"## Testlauf\n",
|
||||
"Zur Demonstration mit 10 Einträgen:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "0045a5a5-f0f6-40c7-a67e-d7abe8ccb2b6",
|
||||
"metadata": {
|
||||
"editable": false,
|
||||
"slideshow": {
|
||||
"slide_type": ""
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"let unsortiert = zufallsArray(10)\n",
|
||||
"console.log(unsortiert)\n",
|
||||
"let sortiert = sort(unsortiert)\n",
|
||||
"console.log(sortiert)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "515167f0-f7bc-4f81-9b6c-fdecddc48cc9",
|
||||
"metadata": {
|
||||
"editable": false,
|
||||
"slideshow": {
|
||||
"slide_type": ""
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"source": [
|
||||
"## Zeitmessung\n",
|
||||
"Mit verschieden großen Arrays (ausprobieren, welche Größe Sinn ergibt).\n",
|
||||
"*(Selbstständig programmieren)*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "4a5c7b17-5096-48a0-a52e-7ce0a7518e4f",
|
||||
"metadata": {
|
||||
"editable": true,
|
||||
"slideshow": {
|
||||
"slide_type": ""
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "1c726b13-ce9c-4853-a720-5536c1ec002f",
|
||||
"metadata": {
|
||||
"editable": false,
|
||||
"slideshow": {
|
||||
"slide_type": ""
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"source": [
|
||||
"## Ergebnisse der Zeitmessung:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "raw",
|
||||
"id": "6987bfbd-0436-49b3-a336-5331027d0159",
|
||||
"metadata": {
|
||||
"editable": true,
|
||||
"raw_mimetype": "",
|
||||
"slideshow": {
|
||||
"slide_type": ""
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"source": []
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "c1e36d9e-0afc-45be-9e4e-887e594e557c",
|
||||
"metadata": {
|
||||
"editable": false,
|
||||
"slideshow": {
|
||||
"slide_type": ""
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"source": [
|
||||
"## Laufzeit"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "raw",
|
||||
"id": "8a15c48b-9f03-4199-9824-fc6d3ff6e90d",
|
||||
"metadata": {
|
||||
"editable": true,
|
||||
"raw_mimetype": "",
|
||||
"slideshow": {
|
||||
"slide_type": ""
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"source": []
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "f96396ff-d977-4704-b75e-b16ba5887440",
|
||||
"metadata": {
|
||||
"editable": false,
|
||||
"slideshow": {
|
||||
"slide_type": ""
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"source": [
|
||||
"## stabil oder nicht-stabil?\n",
|
||||
"mit Begründung:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "raw",
|
||||
"id": "0e8f53ab-c4ec-4f31-8c9e-fec70956e07e",
|
||||
"metadata": {
|
||||
"editable": true,
|
||||
"raw_mimetype": "",
|
||||
"slideshow": {
|
||||
"slide_type": ""
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Deno",
|
||||
"language": "typescript",
|
||||
"name": "deno"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": "typescript",
|
||||
"file_extension": ".ts",
|
||||
"mimetype": "text/x.typescript",
|
||||
"name": "typescript",
|
||||
"nbconvert_exporter": "script",
|
||||
"pygments_lexer": "typescript",
|
||||
"version": "5.8.3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 5
|
||||
}
|
||||
Loading…
Reference in New Issue