mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-24 04:54:21 +08:00
Refactor Code Style (#4151)
This commit is contained in:
@ -8,7 +8,7 @@ package com.thealgorithms.dynamicprogramming;
|
||||
public class RodCutting {
|
||||
|
||||
private static int cutRod(int[] price, int n) {
|
||||
int val[] = new int[n + 1];
|
||||
int[] val = new int[n + 1];
|
||||
val[0] = 0;
|
||||
|
||||
for (int i = 1; i <= n; i++) {
|
||||
@ -24,7 +24,7 @@ public class RodCutting {
|
||||
}
|
||||
|
||||
// main function to test
|
||||
public static void main(String args[]) {
|
||||
public static void main(String[] args) {
|
||||
int[] arr = new int[] { 2, 5, 13, 19, 20 };
|
||||
int result = cutRod(arr, arr.length);
|
||||
System.out.println("Maximum Obtainable Value is " + result);
|
||||
|
Reference in New Issue
Block a user