Question:
John likes to play with string and he always tries to do something new with it. This time he found a very typical way to sort a string. What he did is that he took a string composed of both lowercase and uppercase letters and sorted it in such a manner such that the uppercase and lowercase letter comes in an alternate manner but in sorted way. He needs your help to complete this job as fast as possible.
Example:
Input: bAwutndekWEdkd
Output: AbEdWddekkntuw
Explanation:
Here we can see that letter ‘A’,’E’,’W’ are sorted as well as letters “b,d,d,d,e,k,k,n,t,u,w” are sorted but both appears alternately in the string as far as possible.
Note: Create main() inside the class ‘SortDriver’
Input:
The first line of input contains the string to be sorted.
Output:
Print the string in required sorted format.
Sample Input:
Enter the String: HelLoWoRld
Sample Output:
The Sorted String is: HdLeRlWloo
CODE:–
SortDriver .java
Tags:
data structures programs in java pdf | data structures programs in javatpoint | data structures course in java | data structures and algorithms programs in java |best data structures course in java | data structures programs using java | advanced data structures lab programs in java | data structures and algorithms course in java | basic data structure programs in java | c data structures programs | data structures example programs in java | data structures in java free course |graph data structure program in java | data structures using java | interview programs on data structures in java | linked list data structure program in java | data structure programs on java |
data structures in java online course | queue data structure program in java | data structure programming questions in java | data structures in java coding questions |
data structure coding interview questions java | stack data structure program in java | tree data structure programs in java | tree data structure code in java |
data structures and java | java with data structures programs | data structures programs pdf | 2021 |
ConversionConversion EmoticonEmoticon