Home > Back-end >  The sorting
The sorting

Time:04-23

To a string containing only lowercase letters and Numbers of the positive integer number sequence according to the Numbers in ascending order size, the relative position of the rest of the character remains the same, only change in the original number of substring, such as string as "aaa77xxxx88jj44", after the sorting result is "aaa44xxxx77jj88 non-numeric substring" aaa ", "XXXX" and "jj" relative position remains unchanged,
You need to consider:
(1) integer overflow, such as the Numbers for: "99999999999999999999999999999999", cannot be compared to firing a string into an integer;
(2) the first is 0 digital string processing, such as "00000000000000006" is less than the "7",
Written in Java sort algorithm implementation and output after sort of string,
(test case)
How to put the string of Numbers and letters, respectively in the two arrays, but also sort out their position unchanged!
  • Related