Merge pull request #1027 from salonilakhotia/master

Result print
This commit is contained in:
Yang Libin
2019-10-12 14:06:14 +08:00
committed by GitHub
2 changed files with 5 additions and 4 deletions

View File

@ -16,11 +16,11 @@ public class Fibonacci {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine()); int size = Integer.parseInt(br.readLine());
// Methods all returning [0, 1, 1, 2, 3, 5, ...] for n = [0, 1, 2, 3, 4, 5, ...] // Methods all returning [0, 1, 1, 2, 3, 5, ...] for n = [0, 1, 2, 3, 4, 5, ...]
System.out.println(fibMemo(n)); System.out.println(fibMemo(size));
System.out.println(fibBotUp(n)); System.out.println(fibBotUp(size));
} }
/** /**

View File

@ -26,7 +26,8 @@ public class RodCutting {
public static void main(String args[]) { public static void main(String args[]) {
int[] arr = new int[]{2, 5, 13, 19, 20}; int[] arr = new int[]{2, 5, 13, 19, 20};
int size = arr.length; int size = arr.length;
int result = cutRod(arr,size);
System.out.println("Maximum Obtainable Value is " + System.out.println("Maximum Obtainable Value is " +
cutRod(arr, size)); result);
} }
} }