This question already has an answer here:
I wonder how the verses are ordered in Quran. Looking at this site, it says all verses were ordered in the life time of the prophet, because Quran was being written and was in same order we read today. This site also mentions that the prophet used to recite Quran during prayer in correct order. But then there are these verses in which the verse that abrogates the previous verse are right after each other. For example 58:12-13
O you who have believed, when you [wish to] privately consult the Messenger, present before your consultation a charity. That is better for you and purer. But if you find not [the means] - then indeed, Allah is Forgiving and Merciful.58-12
Have you feared to present before your consultation charities? Then when you do not and Allah has forgiven you, then [at least] establish prayer and give zakah and obey Allah and His Messenger. And Allah is Acquainted with what you do.58-13
Supposedly there were number of days in the above two verse because people stopped coming to the prophet and then the second verse was revealed. Other times the verse that abrogates the previous verse lies far apart from the original verse. When it comes to the last verse of the Quran, it is still not clear. Among the many candidates for the last verse according to this site, many of the verses are not the last verses of the Surah, that proves, the verses order was not in the same order it was revealed.
Can someone clarify this? How were the verses ordered in the Quran? Was it determined by the prophet himself or was it done later in the first caliph period. Thanks