Skip to content
Advertisement

Sorting in java for array only containing 0 and 1

How to sort array

JavaScript

Advertisement

Answer

use any sorting algorithm to do it. For beginner use bubble sort (easy to understand)
Refer Wiki

JavaScript

EDITED
As @Pradeep Said: You may definitely use Array.sort()

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement