Please tell me - How sort character array case insensitive?
input: World
Output: dlorW
Please tell me - How sort character array case insensitive?
input: World
Output: dlorW
Any constraints? Which complexity algo you want? O(N^2)? O(NlogN)?
No constraints.
Algorithm is as follows:
extract all lowercase and uppercase letters into different string
sort each string differently
append the sorted string
display the result
If you need code, comment
By Append, do you mean adding at end or mixing them? Because I feel that for a string “bAdC” he wants it as “AbCd”. Meaning alphabets sorted irrespective of case.
does he want bdAC or as you stated, AbCd? He doesn’t explain that. :
If it is like yours I can use the concept of merge sort while appending sorted strings. Yup appendingg means adding at the end.
I feel he wanted AbCd. I think you should also provide that solution (who knows, might help some1 else XD)
is it possible to use sort function?
yup u can use sort function
One Thing you can do is to either convert all the uppercase to lower case or vice versa and mark them to be changed later.
After doing the above operation just sort the string as usual.
After sorting, traverse the string and convert all those characters stored in temporary vector say mv to be changed later to Uppercase. (Considering you had earlier converted uppercase to lowercase )
Print Your result.
check my implementation it is simpler!
I wasn’t using merge sort though it can be solved using merge sort, check the code probably you’ll get it. I just modified the sort function.
I cant find your code ?
check the link i commented
Lol. 8 seconds difference b/w you giving link and him asking later.
Please write code in java.