Althea Mccree
Tuesday, December 20, 2011
Sort an integer array with single for loop ?
I don't think that is possible. The algorithm needs to look at each item in the array and then determine where to place it. Most likely the algorithm will need to go through the array n*log(n) times. http://en.wikipedia.org/wiki/Quicksort
No comments:
Post a Comment
‹
›
Home
View web version
No comments:
Post a Comment