15 - Lecture 14 [ID:46600]
50 von 709 angezeigt

So can you hear me now?

Thumbs up if you can hear me.

Thank you.

Okay.

So you can hear me.

Very good.

Thanks for the feedback.

Okay.

Everybody's quiet so I guess you want me to start.

I have a question about trees, producer?

Trees.

Yes.

Okay.

Well, maybe just one question.

Any tree we have, we can do it to fulfill the binary.

I know that.

The search tree and the AVL invariant.

What do you mean by any tree?

I mean, like, if there's a possibility or a chance that if you have a given tree,

you cannot make it fulfill the search and the AVL.

I mean, the invariance.

Make your tree to fulfill the BST invariance and if you like the AVL invariant.

It depends how you define your tree.

But if you throw in another invariant and say,

actually it's a trinary tree or don't make restrictions on how many leaves it can have,

then things change again.

You could adopt your binary tree,

right?

It could still mean that even though node has more than two leaves,

that all the values smaller than the root are on the left and all the values that are larger than the root are on the right.

But then I wouldn't call it binary search.

I mean, to some degree it is, right?

It just changes a little bit how many leaves you have to go through.

I would probably call it slightly differently, but the invariance define how your tree will look like.

OK, so your question is probably also if I have a given tree that looks crazy,

can I make it to another tree?

And the question is yes.

But in the worst case, you just process the entire tree like a large area of values,

which you then fill in in your new tree.

And there are some caveats probably to it.

There was one slide also I've briefly mentioned it.

For some conditions, you have to make a decision.

What if you have a lot of similar values in there?

I mean, something you can't test larger, smaller, a lot of fives.

How do you treat this?

And this is just how you define this.

It's probably questionable if you did call it a binary search free invariant.

Could just have another area.

I show you now another trick, which probably also goes in this direction,

how to deal with such situations.

Zugänglich über

Offener Zugang

Dauer

01:29:24 Min

Aufnahmedatum

2023-01-30

Hochgeladen am

2023-01-30 20:06:04

Sprache

en-US

hashmaps and revision

Tags

Python programming
Einbetten
Wordpress FAU Plugin
iFrame
Teilen