MCPcopy Create free account
hub / github.com/Ayush7614/Daily-Coding-DS-ALGO-Practice / main

Method main

Gfg/Java/Largestsum.java:17–31  ·  view source on GitHub ↗
(String []args)

Source from the content-addressed store, hash-verified

15 return maximum_so_far;
16 }
17 public static void main(String []args){
18 int size;
19 System.out.println("Enter size of array");
20 Scanner sc=new Scanner(System.in);
21 size=sc.nextInt();
22 int[] arr = new int[size];
23 System.out.println("Enter the elements of the array: ");
24 for(int i=0; i<size; i++)
25 {
26 //reading array elements from the user
27 arr[i]=sc.nextInt();
28 }
29 int sum=maxSubArraySum(arr);
30 System.out.println("Maximum contiguous sum is "+sum);
31 }
32 }
33/*
34Time Complexity: O(n)

Callers

nothing calls this directly

Calls 1

maxSubArraySumMethod · 0.95

Tested by

no test coverage detected