View Single Post
  #2 (permalink)  
Old 01-19-2008, 11:46 AM
WingedPanther's Avatar   
WingedPanther WingedPanther is offline
Super Moderator
 
Join Date: Jul 2006
Age: 35
Posts: 1,953
Last Blog:
NaNoWriMo Day 15
Rep Power: 24
WingedPanther is a jewel in the roughWingedPanther is a jewel in the roughWingedPanther is a jewel in the roughWingedPanther is a jewel in the rough
Default

Because O() notation ignores a constant multiplier (and usually overhead for memory allocation/function calls), when n is small, the selection sort can actually be more efficient. For example, selection sort's efficiency might be 10 n^2 and merge might be 100 n log n. For n=2, that's 40 verses 60.

There are also times when you have to look at whether merge sort is *significantly* more efficient, given the addition coding time that may be involved.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum
Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall
Reply With Quote