Category: sorting
Similar to Parity Sorting, the Index Parity Sorting can be applied to an array of integers that have equal number of even numbers and odd numbers. You are to …
Given a list of intervals denoted with (start, end), implement a function that returns true if none of these intervals overlap. Definition of Intervals A interval can be defined …
Given an array of non-negative integers, re-arrange the numbers so that the even numbers come before the odd numbers. You may return any answer that satisfy the condition. If …
The Wiggle Sorting may produce more than one possible outcome as long as the final sorted array satisfies: nums <= nums >= nums <= nums Given an unsorted array …
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, …