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

Method reverse

NextPermutation.java:24–30  ·  view source on GitHub ↗
(int nums[],int i,int j)

Source from the content-addressed store, hash-verified

22 }
23
24 public static void reverse(int nums[],int i,int j)
25 {
26 while(i<j)
27 {
28 swap(nums,i++,j--);
29 }
30 }
31
32}

Callers 2

nextPermutationMethod · 0.95

Calls 1

swapMethod · 0.95

Tested by 1