Generate Combination in java

public class Combination {
     void doCombination(char []str,int start,int end){   
     char []data=new char[3];
     int i=0;
     int r=3;// how many element combine in one selection
   void   doCombinationUntil(char []str,char []data,int start,int end,int index,int r){
        if (index==r) {
          for (int j = 0; j < r; j++) {
        for (int i=start; i<=end && end-i+1 >= r-index; i++)
             data[index] = str[i];
             doCombinationUntil(str, data, i+1, end, index+1, r);
     public static void main(String[] args) {  
          String str1=“abcd”;
          Combination obj=new Combination();



 Related Posts:

Check a string value is Integer or not in java. (Solution).

Check  string is hexadecimal number or not (Solution).

Generate Combination in java (Solution).

Generate permutation of string(Solution).

Reverse string in java (Solution).

Find duplicate characters with occurrences in a string(Solution).

Permutation of a number(Soluion).

Split the String in java(Solution).

Convert string into number in java(Solution).

Swap two strings without using any variable(Solution).

Get a number from a string in java(Solution).

Add Two Big Number In Java(Solution).

Expand String(Solution).

Reverse String (Solution).

Leave a Reply

Your email address will not be published. Required fields are marked *

48 − = 41