Why don't you use collection and get benefit of already provided sorted algorithms?
And if you want to sort by the title, it's upon you to either sort ascending or descending. Read this and find out...