Conversation
Implements the Dutch National Flag algorithm to sort an array of 0s, 1s, and 2s in-place. Includes error handling for invalid values and provides examples in the docstring.
for more information, see https://pre-commit.ci
Implements the Dutch National Flag algorithm to sort an array of 0s, 1s, and 2s in-place. Includes error handling for invalid values and examples in the docstring.
Refactor error message handling and update example array format.
|
Do we need more |
|
@cclauss My recommendation: close this as a duplicate. On the broader question — I agree it's low-value as a standalone entry. Its one genuinely instructive idea (three-way partitioning) is already better contextualized in |
Implements the Dutch National Flag algorithm to sort an array of 0s, 1s, and 2s in-place. Includes error handling for invalid values and provides examples in the docstring.
Describe your change:
Checklist:
File added:
arrays/dutch_national_flag_sort.pyReference: https://en.wikipedia.org/wiki/Dutch_national_flag_problem