From fa7101bd7433c39bbf2e24ac3f585564e9560af9 Mon Sep 17 00:00:00 2001 From: Aiyush Kumar Date: Thu, 26 Oct 2023 22:14:13 +0530 Subject: [PATCH] Updated CountSort.java --- DSA_Codesheet/Java/countSort.java | 66 +++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 DSA_Codesheet/Java/countSort.java diff --git a/DSA_Codesheet/Java/countSort.java b/DSA_Codesheet/Java/countSort.java new file mode 100644 index 0000000..d957fc0 --- /dev/null +++ b/DSA_Codesheet/Java/countSort.java @@ -0,0 +1,66 @@ +import java.util.*; + +public class countSort { + public static void main(String[] args) { + Scanner input = new Scanner(System.in); + int n = input.nextInt(); + int arr[] = new int[n]; + for(int i=0; i max) { + max = num; + } + if(num < min) { + min = num; + } + } + return new int[]{min, max}; + } +}