Sort And Searching Question:
Download Questions PDF

Tell me which of the following maintain index associations?

• ksort
• asort
• sort

Answer:

These are php sorting methods.

ksort and asort maintain index associations and sort from lowest to highest. ksort sorts keys.
sort doesnt maintain index associations.

Download Sort And Searching Interview Questions And Answers PDF

Previous QuestionNext Question
Explain which of the following is true about asort?
• Sorts highest to lowest by value maintaining key association.
• Sorts lowest to highest by key maintaining key association.
• Sorts highest to lowest by key, re-indexing the array.
• Sorts lowest to highest by value, re-indexing the array.
Tell me why might quick sort might be better than merge sort