Skip to content

Result print #1027

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions DynamicProgramming/Fibonacci.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ public class Fibonacci {
public static void main(String[] args) throws Exception {

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, ...]
System.out.println(fibMemo(n));
System.out.println(fibBotUp(n));
System.out.println(fibMemo(size));
System.out.println(fibBotUp(size));
}

/**
Expand Down
3 changes: 2 additions & 1 deletion DynamicProgramming/RodCutting.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ private static int cutRod(int[] price, int n) {
public static void main(String args[]) {
int[] arr = new int[]{2, 5, 13, 19, 20};
int size = arr.length;
int result = cutRod(arr,size);
System.out.println("Maximum Obtainable Value is " +
cutRod(arr, size));
result);
}
}