Answer the question
In order to leave comments, you need to log in
What sorting should be applied for words and numbers?
Characters at the input no more than 5000. I am not strong in algorithms (temporarily) and I need advice on which sort to use.
Example:
Input:
car truck 8 -4 bus 6 1
Output:
bus car -4 1 truck 6 8
Answer the question
In order to leave comments, you need to log in
It is worth sorting numbers and words separately, remembering the positions of words and numbers in the input sequence, and then writing them to the output in accordance with this order.
It is worth sorting with a function built into the language, and not writing your own, if this is not required by the condition of the problem.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question