Skip to content

Latest commit

 

History

History
21 lines (17 loc) · 843 Bytes

README.md

File metadata and controls

21 lines (17 loc) · 843 Bytes

AlphaNumericComparator

Sorter that compares the given Alpha-numeric strings. This iterates through each characters to decide the sort order. There are 2 possible cases while iterating,

  • When the current character under comparison in at-least one of the given String is a non-digit the particular character alone compared lexically.
  • When the current character under comparison in both of the String is a digit, the consecutive digit characters in both the Strings will be considered for comparison.
  • At any point if the comparison confirms the order(either > or <) then the consecutive characters will not be considered.
  • For ex., this will be the ordered O/P of the given list of Strings.(The bold characters decides its order) 2b,100b,a1,A2y,a100