DSA_Worksheet icon indicating copy to clipboard operation
DSA_Worksheet copied to clipboard

Count Sort

Open AiyushKumar07 opened this issue 1 year ago • 9 comments

Write Code in Only One Language (CPP, C, Java, Python)

Give File Name : <CountSort> ✅ In respective language folder

📑 DESCRIPTION

Problem Title

Difficulty

Problem Statement: Given an arr consisting of positive digits, sort the array in ascending order using Counting Sort.

Note: Use only Counting Sort Algorithm

Input Format:

First line will contain a single integer - the size of list
Second line will contain space separated integers of given length

Input format here

5 
4 3 9 2 2 1

Output Format:

Array Before Sorting :- 
Space separated list of integers (Unsorted)
Array After Sorting :-
Space separated list of integers (Sorted)

Output format here

1 2 2 3 4 9

Example

Example

Sample Input 1

9
44 65 12 12 77 22 22 1 1 

Sample Output 1

Array Before Sorting :- 
44 65 12 12 77 22 22 1 1 
Array After Sorting :-
1 1 12 12 22  22 44 65 77

Sample Input 2

3 
9 9 1

Sample Output 2

Array Before Sorting :- 
9 9 1
Array After Sorting :-
1 9 9 

Constraints

0 <= n <= 1000
TC - O(n+k)

Leetcode Sort Array

AiyushKumar07 avatar Oct 21 '23 04:10 AiyushKumar07

hey, can you please assign me this issue

Rohit-sharma04 avatar Oct 21 '23 04:10 Rohit-sharma04

@lilmistake Please assign this to me for Java Based Solution...~~

AiyushKumar07 avatar Oct 21 '23 04:10 AiyushKumar07

hello, can you please assign me this issue for python based solution

Raj-sharma01 avatar Oct 21 '23 05:10 Raj-sharma01

@lilmistake can you assign me for C based solution?

The-APK avatar Oct 21 '23 08:10 The-APK

Please assign this to me for python based solution

Pankaj4152 avatar Oct 23 '23 20:10 Pankaj4152

@lilmistake can you please review my PR #63

Raj-sharma01 avatar Oct 24 '23 03:10 Raj-sharma01

Hey @lilmistake please review my PR #94

Rohit-sharma04 avatar Oct 27 '23 10:10 Rohit-sharma04

@lilmistake @Chitresh-code please review my PR #94

Rohit-sharma04 avatar Oct 28 '23 09:10 Rohit-sharma04

@lilmistake @Chitresh-code hacktoberfest is about to end please review my PR #94 and if there is no problem please merge it

Rohit-sharma04 avatar Oct 30 '23 02:10 Rohit-sharma04