Created
October 26, 2017 16:03
-
-
Save Tekaichi/1ca88a9cf55496bc41755277880fac17 to your computer and use it in GitHub Desktop.
Recursive thingy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static int recSeparate(int[] v, int i, List<Integer> list, int threshold) { | |
if(i == v.length){ | |
return 0; | |
} | |
if(v[i] < threshold){ | |
int a = recSeparate(v,i+1,list,threshold); | |
list.add(a, v[i]); | |
return a; | |
}else{ | |
list.addLast(v[i]); | |
return recSeparate(v,++i,list,threshold); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment