Skip to content

kannangce/AlphaNumericComparator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

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

    About

    A basic Java comparator for alphanumeric sorting.

    Resources

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

    No packages published

    Languages