From d11d6657890c4d7601fdcce44c16d64d748b9a2f Mon Sep 17 00:00:00 2001 From: Lipasa Date: Sun, 1 Oct 2023 15:51:11 +0530 Subject: [PATCH] array --- Array/MaximumSubarraySum.java | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Array/MaximumSubarraySum.java 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