Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
I think you're right, master. Why do we need to care about perfomance in a knight move task? I have no idea, but we still do it.
guys, just stop focusing on performances on something that does not require any kind of performances. You have mostly no idea what you're measuring there.
all this is O(1): there are always exactly 3 elements to sort anyway. And talking big O when N is not bg has absolutely no sense.
Good catch! According to StackOverflow,
O(n) + O(n log(n)) = O(n log(n))
. For Big O complexity, all that matters is the dominant term.n log(n)
dominatesn
in this situation therefore, that's the only term that matters (source).The time complexity of the
map()
function isO(n)
.The reason that we don't use constants with big O notation is because, theoretically they don't matter much. What we are calculating with time-complexity is the speed at which something will grow, having a constant on there will be completely irrelevant when a large enough input is used
Nice!