mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-19 09:50:03 +08:00
Fix package declarations (#2576)
This commit is contained in:

committed by
GitHub

parent
60a0c23544
commit
2b7a977cc8
@ -1,3 +1,5 @@
|
||||
package DynamicProgramming;
|
||||
|
||||
// Given N dice each with M faces, numbered from 1 to M, find the number of ways to get sum X.
|
||||
// X is the summation of values on each face when all the dice are thrown.
|
||||
|
||||
@ -14,9 +16,6 @@ Following is implementation of Dynamic Programming approach. */
|
||||
// Code ---->
|
||||
// Java program to find number of ways to get sum 'x' with 'n'
|
||||
// dice where every dice has 'm' faces
|
||||
import java.util.*;
|
||||
import java.lang.*;
|
||||
import java.io.*;
|
||||
|
||||
class DP {
|
||||
/* The main function that returns the number of ways to get sum 'x' with 'n' dice and 'm' with m faces. */
|
||||
|
@ -1,7 +1,4 @@
|
||||
package test;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
package DynamicProgramming;
|
||||
|
||||
/**
|
||||
* Algorithm explanation https://www.educative.io/edpresso/longest-palindromic-subsequence-algorithm
|
||||
|
@ -1,7 +1,4 @@
|
||||
package test;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
package DynamicProgramming;
|
||||
|
||||
/*
|
||||
* Algorithm explanation https://leetcode.com/problems/longest-palindromic-substring/
|
||||
|
@ -15,9 +15,6 @@ Subset1 = {7, 46} ; sum of Subset1 = 53
|
||||
Subset2 = {36, 40} ; sum of Subset2 = 76
|
||||
*/
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
public class MinimumSumPartition {
|
||||
public static int subSet(int[] arr) {
|
||||
int n = arr.length;
|
||||
|
@ -1,4 +1,7 @@
|
||||
package DynamicProgramming;
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief Implements [Palindrome
|
||||
@ -16,9 +19,6 @@ package DynamicProgramming;
|
||||
* "aba | b | bbabb | ababa"
|
||||
* @author [Syed] (https://github.com/roeticvampire)
|
||||
*/
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
public class PalindromicPartitioning {
|
||||
|
||||
public static int minimalpartitions(String word){
|
||||
@ -31,7 +31,7 @@ public class PalindromicPartitioning {
|
||||
int[] minCuts = new int[len];
|
||||
boolean[][] isPalindrome = new boolean[len][len];
|
||||
|
||||
int i, j, k, L; // different looping variables
|
||||
int i, j, L; // different looping variables
|
||||
|
||||
// Every substring of length 1 is a palindrome
|
||||
for (i = 0; i < len; i++) {
|
||||
|
@ -1,3 +1,5 @@
|
||||
package DynamicProgramming;
|
||||
|
||||
// Java program to find length of the shortest supersequence
|
||||
class ShortestSuperSequence {
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
package DynamicProgramming;
|
||||
|
||||
public class Sum_Of_Subset {
|
||||
public static void main(String[] args){
|
||||
|
||||
|
Reference in New Issue
Block a user