MCPcopy Create free account
hub / github.com/Tiwarishashwat/InterviewCodes / main

Method main

RearrangeArrayInAlternatingPositions.java:3–11  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

1public class Main
2{
3 public static void main(String[] args) {
4 // int arr[] = {-5, -2, 5, 2, 4, 7, 1, 8, 0, -8};
5 // int arr[] = {1, 2, 3, -4, -1, 4};
6 int arr[] = {2,-8,-3,-5,-7,-1,-2};
7 int output[]=new int[arr.length];
8 output=rearrange(arr,arr.length);
9 print(output);
10
11 }
12 public static void print(int output[])
13 {
14 for(int i=0;i<output.length;i++)

Callers

nothing calls this directly

Calls 2

rearrangeMethod · 0.95
printMethod · 0.95

Tested by

no test coverage detected