This code is identical to this.

This is going to actually find the smallest element in L and say that,

and put it in x.

Now, is this telling us anything more than this about what we want to do?

The answer is no.

I would argue that this is not telling me anything more than this about what

I want to do.

It's basically telling me, I want to set to x the smallest element in the list.

What is this giving me more than this?

It's telling me the how, how am I doing it.

Right?

So this one is saying, to find the minimum element in L,

I'm going to be scanning the list all the way from the left to

the right to find the smallest element and I will return that.

Okay? So

[COUGH] this is where pseudo-code allows me, gives me wiggle room to play with how

much description or how much detail I need to give and the algorithm description.

This is acceptable pseudo-code, this is acceptable pseudo-code,

this is not acceptable in Python or in C Plus Plus or in Pascal.

This, if it is translated to proper Python, this will be acceptable,

this is very detailed and this, you know, in terms of instead of putting left arrow,

I would put equal.

In terms of mathematical symbol of infinity,

I will have to put proper thing in Python.

But this is basically would translate one to one, line for line into Python.

Right?

But again, in terms of what am I trying to achieve,

this is not telling my anything more than this.

In fact, I would argue that this is more readable than this.

But again, if I say how long does it take to find the minimum element in the list?

It's not easy to, to answer that question with this, because okay,

you are telling me that I find the smallest element.

It is easy to answer this,

if the list has n elements, this is going to take on the order of n operation.

Why it's not easy to find, to say, what is the running time of this?

You might say, well, look this is how I would find the minimum element.

That's not necessarily always the case.

I will give you another way of finding

the minimum element which is [SOUND]

sort the list L in increasing order, return, L0.

Okay.

This is another pseudo-code that is doing exactly the same like this in terms of

what we want to achieve.

It is sorting the list L in increasing order,

returning the first element in L after it is sorted.

Now notice, this is different than this, different than this.

They are, all three of them are finding the minimum element in the list.

This is going to differ from that in terms of the details.

And also is going to differ in terms of the running time.

This one here for example, what is the time it takes to sort the list?