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.
There are several problems with this kata:
Math.ceil(Math.log2(array.length))
times. Imagine the smallest value is at the right. You needarray.length - 1
iterations of the inner loop to get it to the left.it
is a description of the test."Yes"
is not a description.Test.assertSimilar()
. That function converts both arguments to strings and compares those strings. The message is unnecessarily hard to read. UseTest.asserDeepEquals()
instead.bubbleSort.toString()
and search that string for the substring"sort"
. There are many techniques to circumvent that, e.g. what mrtp0 did.