You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All elements smaller than the kth element are moved before this element and
all equal or greater are moved behind it.
That's not quite correct, because some of the elements before the kth element could be equal to the kth element. A trivial example is an input containing all the same values. Perhaps a better wording is something like:
In the partitioned array, all elements before the `kth` element are less than or
equal to that element, and all the elements after the `kth` element are greater than
or equal to that element.
The text was updated successfully, but these errors were encountered:
On reading it again, I see that it is not incorrect--all the elements smaller than the kth element are moved before this element. So my suggestion is to tweak the docstring to make clear that in the result, not all the elements before the kth are less than the kth element. Some might equal the kth element.
The docstring for the
partition
method says:That's not quite correct, because some of the elements before the
kth
element could be equal to thekth
element. A trivial example is an input containing all the same values. Perhaps a better wording is something like:The text was updated successfully, but these errors were encountered: