diff --git a/Array/MaximumSubarraySum.java b/Array/MaximumSubarraySum.java new file mode 100644 index 0000000..c861650 --- /dev/null +++ b/Array/MaximumSubarraySum.java @@ -0,0 +1,37 @@ +package p1; + +import java.util.*; +public class MaximumSubarraySum { + //code to find the maximum sum of a subarray in an array using the kadane's algorithm + + public static void main(String[] args) { + Scanner sc=new Scanner(System.in); + + System.out.println("enter the size of array"); + int size=sc.nextInt(); + int arr[]=new int[size]; + + System.out.println("enter the elements of the array"); + for(int i=0;i