import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;

public class Combinations {
    public List<List<Integer>> combine(int n, int k) {
        if (k == n || k == 0) {
            List<Integer> row = new LinkedList<>();
            for (int i = 1; i <= k; ++i) {
                row.add(i);
            }
            return new LinkedList<>(Arrays.asList(row));
        }
        
        List<List<Integer>> result = this.combine(n - 1, k - 1);
        for (List<Integer> temp : result){
            temp.add(n);
        }
        result.addAll(this.combine(n - 1, k));
        return result;
    }
}

@@ -19,34 +19,8 @@
 rray
-s;%0Aimport java.util.Linked
 List
@@ -124,24 +124,86 @@
 n, int k) %7B%0A
+        // Base case; %5B%5B1%5D,%5B2%5D,%5B3%5D,...,%5Bn%5D%5D & %5B%5B1,2,3,...,n%5D%5D%0A
         if (
@@ -252,24 +252,24 @@
 er%3E 
-row
+elem
  = new 
-Linked
+Array
 List
@@ -333,19 +333,20 @@
         
-row
+elem
 .add(i);
@@ -376,71 +376,188 @@
     
-return new LinkedList%3C%3E(Arrays.asList(row));%0A        %7D%0A        
+ArrayList%3CList%3CInteger%3E%3E base = new ArrayList%3C%3E();%0A            base.add(elem);%0A            return base;%0A        %7D%0A%0A        // recursive call to combine method, Choose k-1 from n-1;
 %0A   
@@ -618,16 +618,62 @@
 k - 1);%0A
+        // Add n to all previous sub problem.%0A
         
@@ -734,32 +734,96 @@
 d(n);%0A        %7D%0A
+        // recursive call to combine method, Choose k from n-1;%0A
         result.a

Add comments to combinations.