Discussion about this post

User's avatar
Randy Maxwell's avatar

Very much appreciate this article.

When i was reading the Initial example i was visualizing what the Array would look like.

Sorry but i do not follow the

Time to Compute

formula

given in the Initial example.

A fixed size array (100 possible scores + 1) is populated with # of students with the score used as the position index.

A Range from low to high is given for array indexes of interest.

Wouldn't the notation be more clear using low & high rather than r & l ?

Array memory access is O(1) to get to a start position and value.

Maybe memory access times are not important here.

The number of positions to be visited is (high - low + 1)

If the range is just 1 (high = low)

The total is just O(1) ?

I don't see how O(N = 100) is an invariant here.

Thanks for the article, i need to be more dangerous with structures !

Expand full comment
1 more comment...

No posts