Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

I'm trying to learn how to implement various sorting algorithms(for job interviews) and i'm a little bit unsure about the general approach for comparing 2 values.For numbers it's easy but what about Strings ?What is a common way to compare 2 strings if you want to sort them alphabetically ?

Any response is highly appreciated .

share|improve this question

put on hold as unclear what you're asking by gnat, Jörg W Mittag, MichaelT, GlenH7, Ixrec 2 days ago

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

1  
Unclear what help you need. Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it’s hard to tell what problem you are trying to solve or what aspect of your approach needs to be corrected or explained. See the How to Ask page for help clarifying this question. –  gnat 2 days ago
    
...also note that off-site resource recommendations ("books or sources..") are explicitly off-topic per help center. See meta.programmers.stackexchange.com/questions/6483/… Wonder by the way if you read what interview tag says, "DO NOT USE..." –  gnat 2 days ago
    
For general resources list for language X, go to stackoverflow, click on the tag for X (e.g. java) and then read the information there. –  Brandin 2 days ago
    
If you are trying to learn multiple sorting algorithms without the often terse content in text books, you can try stepping through different implementations in your debugger for a small data set to relate the actual implementation to how it might be described in text. It is otherwise hard to say that there is a general approach around sorting algorithms. The authors of each algorithm have worked out different ways to sort data given different requirements or a desire to improve efficiency –  Jason 2 days ago

Browse other questions tagged or ask your own question.