MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / pushZero

Method pushZero

Java/Array/PushZeroEnd.java:65–75  ·  view source on GitHub ↗
(int [] arr)

Source from the content-addressed store, hash-verified

63 }
64
65 public static void pushZero(int [] arr) {
66 int nonZero = 0;
67 for (int i = 0; i < arr.length; i++) {
68 if ( arr[i] != 0) {
69 int temp = arr[i];
70 arr[i] = arr[nonZero];
71 arr[nonZero] = temp;
72 nonZero++;
73 }
74 }
75 }
76
77
78 public static int [] takeInput(){

Callers 1

mainMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected