So, after we kind of looked a little bit more at recursive or functional programming, I'm
hoping that for you the pain lessons, i.e. you can deal with it, who of you feels comfortable
with recursive programming by now?
Well, if that's zero, then you'll have to practice more.
We're going to probably give you more homework for the opportunity of practicing.
But you can also just come up with your own examples.
The thing I always like to do is writing a vocab trainer.
You give it a list of German, French or Chinese, Russian vocabulary pairs and then you just
basically let it kind of randomly step through the list and whenever you know the correct
vocab, those kind of things.
You can't have a very kind of program this long and if you can do that, you can do essentially
everything.
But there's just no substitute for actually suffering through doing it yourself.
The only way it's going to get better is by practicing.
I know this because I've done it.
It's now 30 years past and it was painful and at some point your kind of brain gives
up its opposition.
Kind of just accepts that this is something it can do.
And the earlier it does, the more fun you have.
Okay, so the next topic which we've already started is graphs and trees.
And I'm assuming that you already know about them.
I'm assuming you had a class, algorithms and data structures in your past at some point
and you've been basically been dealing with graphs and trees.
Very important symbolic data structures.
But maybe not in kind of a rigorous function.
That's what I want to do now.
And we've briefly started to kind of think about graphs.
Mostly graphs are things like...
Here we have a directed graph.
So we can start doing things, right?
If we want to formalize it, if we want to kind of look at the mathematics of this,
the first thing we always do is we decide of what are the properties we're interested in.
And for graphs, we're not interested in the shape.
If I say, aha, this and that, we've changed nothing.
Also, if I make this thing blue, we're not interested in that.
We're only interested in the blobs and the arrows.
OK, so it makes a lot of sense to basically say, yeah, blobs and arrows, that's what a graph is.
So we start saying, well, we have a set of blobs, but we're going to be sophisticated
and call them nodes or vertices or something like this.
And we have the arrows, the edges, which are just ordered pairs in this case,
because they have a direction.
So very naturally, a graph is a set of nodes and a set of edges,
which are again ordered pairs of nodes.
Very simple.
We can do this differently, depending on what we want.
If we want to have multiple edges, we have to do something different,
because these two edges, say this is node A and this is node B,
are both AB and thereby indistinguishable.
So we can't have two edges between two nodes.
So we cannot do that here.
Presenters
Zugänglich über
Offener Zugang
Dauer
01:29:35 Min
Aufnahmedatum
2025-07-01
Hochgeladen am
2025-07-01 18:39:06
Sprache
en-US