Skip to content
Snippets Groups Projects
Commit 75d4fb80 authored by Peter Gerwinski's avatar Peter Gerwinski
Browse files

Sommersemester 2025

parent d5cf7720
No related branches found
No related tags found
No related merge requests found
Showing
with 0 additions and 414 deletions
Termine, 04.04.2024, 11:01:41
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Vormittagstermin ungünstig? 3
Möglichst viele möglichst lange Sitzungen ab 13:15 Uhr? 7
--> Konsens:
* Wir beginnen immer ab 13:15 Uhr (gemeinsam mit dem 6./8. Semester TI)
* Wir enden immer um 18:00 Uhr.--> 6 SWS
* Der Raum bleibt bis auf weiteres der DV-Pool 0-32
bzw. online in Mumble (Seminarraum 2) und VNC (Kanal 6).
* An Tagen, an denen Praktika stattfinden ("Requirements and Software Engineering" (SE)
oder "Grundlagen der Regelungstechnik" (GRT)) findet "Algorithmen und Datenstrukturen"
nicht statt.
* An Tagen, an denen nur ein Teil der Studierenden Praktikum SE oder GRT hat,
kann parallel ein "Praktikum" "Algorithmen und Datenstrukturen" stattfinden.
* Praktikum "Algorithmen und Datenstrukturen" bedeutet: Sie können an Ihren Projekten
arbeiten. Auch Praktikumstermine für andere Lehrveranstaltungen (z.B. dbs, hp) sind
möglich.
Heute:
* Jetzt geht es erst mal weiter bis 12:15 Uhr.
* Es geht nach der Mittagspause um 13:15 Uhr weiter.
* Wir machen dann bis mindestens 16:15 Uhr weiter,
maximal bis 18:00 Uhr,
notfalls aber auch bis 19:00 Uhr.
Studiengang "Technische Informatik":
* gemeinsam mit "Angewandte Informatik"
* Statt von 13:15 bis 17:00 Uhr mit 1 Pause: 13:15 bis 18:00 Uhr mit 2 Pausen,
im Ausgleich: insgesamt weniger Sitzungen
Spezieller Termin:
* Am 16.5.2024 geht "Algorithmen und Datenstrukturen" nur bis 17:15 Uhr.
Ab 17:30 Uhr findet dann im Rahmen der "Ringvorlesung" ein Vortrag statt:
P. Gerwinski:
Was ist dunkle Materie?
Raum: voraussichtlich 3-30 + online
Langzahl-Arithmetik, 04.04.2024, 14:14:45
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gegeben: ganze Zahlen, größer als das, was der Rechner normalerweise verarbeiten kann
Ziel: damit rechnen: + - * / %
Aufgabe: +
(a) Überlegen Sie sich eine Datenstruktur, um eine lange Zahl zu speichern.
(b) Schreiben Sie eine Funktion, die zwei lange Zahlen addiert.
.file "add-01.c"
.text
.section .rodata
.LC0:
.string "%llu\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movabsq $5000000000, %rax
movq %rax, -8(%rbp)
movabsq $6000000000, %rax
movq %rax, -16(%rbp)
movq -8(%rbp), %rdx
movq -16(%rbp), %rax
addq %rdx, %rax
movq %rax, -24(%rbp)
movq -24(%rbp), %rax
movq %rax, %rsi
leaq .LC0(%rip), %rax
movq %rax, %rdi
movl $0, %eax
call printf@PLT
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.ident "GCC: (Debian 12.2.0-14) 12.2.0"
.section .note.GNU-stack,"",@progbits
.file "add-01.c"
.text
.section .rodata.str1.1,"aMS",@progbits,1
.LC0:
.string "%llu\n"
.text
.globl main
.type main, @function
main:
.LFB11:
.cfi_startproc
subq $8, %rsp
.cfi_def_cfa_offset 16
movabsq $11000000000, %rsi
leaq .LC0(%rip), %rdi
movl $0, %eax
call printf@PLT
movl $0, %eax
addq $8, %rsp
.cfi_def_cfa_offset 8
ret
.cfi_endproc
.LFE11:
.size main, .-main
.ident "GCC: (Debian 12.2.0-14) 12.2.0"
.section .note.GNU-stack,"",@progbits
.file "add-01.c"
.text
.section .rodata
.LC0:
.string "%llu\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
leal 4(%esp), %ecx
.cfi_def_cfa 1, 0
andl $-16, %esp
pushl -4(%ecx)
pushl %ebp
movl %esp, %ebp
.cfi_escape 0x10,0x5,0x2,0x75,0
pushl %esi
pushl %ebx
pushl %ecx
.cfi_escape 0xf,0x3,0x75,0x74,0x6
.cfi_escape 0x10,0x6,0x2,0x75,0x7c
.cfi_escape 0x10,0x3,0x2,0x75,0x78
subl $44, %esp
call __x86.get_pc_thunk.si
addl $_GLOBAL_OFFSET_TABLE_, %esi
movl $705032704, -32(%ebp)
movl $1, -28(%ebp)
movl $1705032704, -40(%ebp)
movl $1, -36(%ebp)
movl -32(%ebp), %ecx
movl -28(%ebp), %ebx
movl -40(%ebp), %eax
movl -36(%ebp), %edx
addl %ecx, %eax
adcl %ebx, %edx
movl %eax, -48(%ebp)
movl %edx, -44(%ebp)
subl $4, %esp
pushl -44(%ebp)
pushl -48(%ebp)
leal .LC0@GOTOFF(%esi), %eax
pushl %eax
movl %esi, %ebx
call printf@PLT
addl $16, %esp
movl $0, %eax
leal -12(%ebp), %esp
popl %ecx
.cfi_restore 1
.cfi_def_cfa 1, 0
popl %ebx
.cfi_restore 3
popl %esi
.cfi_restore 6
popl %ebp
.cfi_restore 5
leal -4(%ecx), %esp
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE0:
.size main, .-main
.section .text.__x86.get_pc_thunk.si,"axG",@progbits,__x86.get_pc_thunk.si,comdat
.globl __x86.get_pc_thunk.si
.hidden __x86.get_pc_thunk.si
.type __x86.get_pc_thunk.si, @function
__x86.get_pc_thunk.si:
.LFB1:
.cfi_startproc
movl (%esp), %esi
ret
.cfi_endproc
.LFE1:
.ident "GCC: (Debian 12.2.0-14) 12.2.0"
.section .note.GNU-stack,"",@progbits
.file "add-01.c"
.text
.section .rodata.str1.1,"aMS",@progbits,1
.LC0:
.string "%llu\n"
.text
.globl main
.type main, @function
main:
.LFB11:
.cfi_startproc
leal 4(%esp), %ecx
.cfi_def_cfa 1, 0
andl $-16, %esp
pushl -4(%ecx)
pushl %ebp
movl %esp, %ebp
.cfi_escape 0x10,0x5,0x2,0x75,0
pushl %ebx
pushl %ecx
.cfi_escape 0xf,0x3,0x75,0x78,0x6
.cfi_escape 0x10,0x3,0x2,0x75,0x7c
call __x86.get_pc_thunk.bx
addl $_GLOBAL_OFFSET_TABLE_, %ebx
subl $4, %esp
pushl $2
pushl $-1884901888
leal .LC0@GOTOFF(%ebx), %eax
pushl %eax
call printf@PLT
addl $16, %esp
movl $0, %eax
leal -8(%ebp), %esp
popl %ecx
.cfi_restore 1
.cfi_def_cfa 1, 0
popl %ebx
.cfi_restore 3
popl %ebp
.cfi_restore 5
leal -4(%ecx), %esp
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE11:
.size main, .-main
.section .text.__x86.get_pc_thunk.bx,"axG",@progbits,__x86.get_pc_thunk.bx,comdat
.globl __x86.get_pc_thunk.bx
.hidden __x86.get_pc_thunk.bx
.type __x86.get_pc_thunk.bx, @function
__x86.get_pc_thunk.bx:
.LFB12:
.cfi_startproc
movl (%esp), %ebx
ret
.cfi_endproc
.LFE12:
.ident "GCC: (Debian 12.2.0-14) 12.2.0"
.section .note.GNU-stack,"",@progbits
#include <stdio.h>
#include <stdint.h>
int main (void)
{
uint64_t x = 5000000000;
uint64_t y = 6000000000;
uint64_t z = x + y;
printf ("%llu\n", z);
return 0;
}
#include <stdio.h>
#include <stdint.h>
#include <inttypes.h>
int main (void)
{
uint64_t x = 5000000000;
uint64_t y = 6000000000;
uint64_t z = x + y;
printf ("%" PRIu64 "\n", z);
return 0;
}
#include <stdio.h>
int main (void)
{
char a[] = "Test";
char *p = "Test";
printf ("a = %s, p = %s\n", a, p);
return 0;
}
#include <stdio.h>
int main (void)
{
char a[] = { 84, 101, 115, 116, 0 };
char *p = "Test";
printf ("a = %s, p = %s\n", a, p);
return 0;
}
#include <stdio.h>
int main (void)
{
char a[] = { 84, 101, 115, 116, 0 };
char *p = "Test";
printf ("a = %s, p = %s\n", &a, &p);
return 0;
}
#include <stdio.h>
int main (void)
{
char *a[] = { "Dies", "ist", "ein", "Test" };
char **p = a;
for (int i = 0; i < 4; i++)
printf ("%s\n", p[i]);
return 0;
}
#include <stdio.h>
int main (void)
{
char *a[] = { "Dies", "ist", "ein", "Test" };
char **p = a;
for (int i = 0; i < 4; i++)
printf ("%s\n", *p++);
return 0;
}
#include <stdio.h>
int main (void)
{
char *a[] = { "Dies", "ist", "ein", "Test" };
char **p = a;
for (int i = 0; i < 4; i++)
printf ("%s\n", p[i]++);
return 0;
}
#include <stdio.h>
int main (void)
{
char *a[] = { "Dies", "ist", "ein", "Test" };
char **p = a;
for (int i = 0; i < 4; i++)
{
char *q;
printf ("%s ", q = p[i]++);
printf ("%s\n", q);
}
return 0;
}
#include <stdio.h>
int main (void)
{
char *a[] = { "Dies", "ist", "ein", "Test" };
char **p = a;
for (int i = 0; i < 4; i++)
{
printf ("%s ", p[i]++);
printf ("%s\n", p[i]);
}
return 0;
}
#include <stdio.h>
int main (void)
{
char *a[] = { "Dies", "ist", "ein", "Test" };
for (char **p = a; p < a + 4; p++)
printf ("%s\n", *p);
return 0;
}
#include <stdio.h>
int main (void)
{
char *a[] = { "Dies", "ist", "ein", "Test", NULL };
for (char **p = a; *p; p++)
printf ("%s\n", *p);
return 0;
}
#include <stdio.h>
int main (void)
{
char a[][5] = { "Dies", "ist", "ein", "Test" };
for (int i = 0; i < 4; i++)
printf ("%s\n", a[i]);
return 0;
}
#include <stdio.h>
int main (void)
{
char a[][] = { "Dies", "ist", "ein", "Test" };
for (int i = 0; i < 4; i++)
printf ("%s\n", a[i]);
return 0;
}
#include <stdio.h>
int main (void)
{
char a[][5] = { "Dies", "ist", "ein", "Test", "" };
for (char *p = a; *p; p++)
printf ("%s\n", *p);
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment