inf-abi2027/02 Sortieralgorithmen/02 Programmierprojekt/00 Vorlage.ipynb

261 lines
4.9 KiB
Plaintext

{
"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
}