Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpp-generic-sort.cpp #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

cpp-generic-sort.cpp #23

wants to merge 1 commit into from

Conversation

himanshusharma89
Copy link

@himanshusharma89 himanshusharma89 commented Oct 27, 2019

You need to sort elements of an array where the array can be of following data-types: Integer, String, floating number. Your task is to complete the given two functions: sortArray() and printArray()
Input:
The input line contains T, denoting the number of test cases. Each test case contains 2 lines. The first line contains n(size of array) and q(type of array) separated by space. Below is the description of q.
q = 1, means elements of the array are of integer type
q = 2, means elements of the array are of string type
q = 3, means elements of array are of floating digit type
The second line contains n elements of the array separated by space.
Output:
For each testcase in new line, print the elements in sorted form of given type of array separated by space.
Constraints:
1 <= T <= 50
1 <= n <= 100
1 <= q <= 3

You need to sort elements of an array where the array can be of following data-types:  Integer String floating numbe Your task is to complete the given two functions: sortArray() and printArray()
Copy link
Owner

@namanvats namanvats left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put proper Comments in your code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants