@@ -0,0 +1,1164 @@
+package algorithms.dp;%0A%0A/**%0A * Created by sudharti on 5/26/17.%0A */%0Apublic class EggDroppingProblem %7B%0A  public int minAttemptsRecursive(int floors, int eggs) %7B%0A    if (floors == 0 %7C%7C floors == 1) %7B%0A      return floors;%0A    %7D else if (eggs == 1) %7B%0A      return floors;%0A    %7D else %7B%0A      int min = Integer.MAX_VALUE;%0A      for (int i = 1; i %3C= floors; i++) %7B%0A        min = Math.min(min, Math.max(1 + minAttemptsRecursive(i - 1, eggs - 1),%0A                1 + minAttemptsRecursive(floors - i, eggs)));%0A      %7D%0A      return min;%0A    %7D%0A  %7D%0A%0A  public int minAttemptsDP(int floors, int eggs) %7B%0A    int%5B%5D%5B%5D results = new int%5Beggs + 1%5D%5Bfloors + 1%5D;%0A    for (int i = 1; i %3C results%5B0%5D.length; i++) %7B%0A      results%5B1%5D%5Bi%5D = i;%0A    %7D%0A%0A    for (int i = 2; i %3C (eggs + 1); i++) %7B%0A      for (int j = 1; j %3C (floors + 1); j++) %7B%0A        if (i %3E j) %7B%0A          results%5Bi%5D%5Bj%5D = j;%0A        %7D else %7B%0A          int min = Integer.MAX_VALUE;%0A          for (int k = 1; k %3C= j; k++) %7B%0A            min = Math.min(min, Math.max((1 + results%5Bi - 1%5D%5Bk - 1%5D), (1 + results%5Bi%5D%5Bj - k%5D)));%0A          %7D%0A          results%5Bi%5D%5Bj%5D = min;%0A        %7D%0A      %7D%0A    %7D%0A%0A    return results%5Beggs%5D%5Bfloors%5D;%0A  %7D%0A%7D%0A

Add solution for EggDropping problem