Skip to content

C++ Header File for Natural Comparision and Natural Sort

License

Notifications You must be signed in to change notification settings

scopeInfinity/NaturalSort

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NaturalSort CI

C++ Header File for Natural Comparison and Natural Sort

Calling Methods
  • For Natural Sorting

     void SI::natural::sort(Container<String>);
     
     void SI::natural::sort(IteratorBegin<String>,IteratorEnd<String>);
     
     void SI::natural::sort<String,CArraySize>(CArray<String>);
    
  • For Natural Comparision

     bool SI::natural::compare<String>(String lhs,String rhs);
     bool SI::natural::compare<String>(char *const lhs,char *const rhs);
    

    Here we can have

     	std::vector<std::string> 	as Container<String>
     	String 					as std::string
     	CArray<String>			as std::string[CArraySize]
    
Example
  • Inputs

     Hello 100
     Hello 34
     Hello 9
     Hello 25
     Hello 10
     Hello 8
    
  • Normal Sort Output

     Hello 10
     Hello 100
     Hello 25
     Hello 34
     Hello 8
     Hello 9
    
  • Natural Sort Output

     Hello 8
     Hello 9
     Hello 10
     Hello 25
     Hello 34
     Hello 100
    

About

C++ Header File for Natural Comparision and Natural Sort

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •