Chitresh-code / DSA_Worksheet

Worksheet posting DSA problems every day for GNIOT Students to solve and create PR's.
MIT License
17 stars 34 forks source link

Count Sort #58

Open AiyushKumar07 opened 10 months ago

AiyushKumar07 commented 10 months ago

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

Give File Name : βœ… 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

Rohit-sharma04 commented 10 months ago

hey, can you please assign me this issue

AiyushKumar07 commented 10 months ago

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

Raj-sharma01 commented 10 months ago

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

The-APK commented 10 months ago

@lilmistake can you assign me for C based solution?

Pankaj4152 commented 10 months ago

Please assign this to me for python based solution

Raj-sharma01 commented 10 months ago

@lilmistake can you please review my PR #63

Rohit-sharma04 commented 10 months ago

Hey @lilmistake please review my PR #94

Rohit-sharma04 commented 10 months ago

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

Rohit-sharma04 commented 10 months ago

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