I've got to count the number of comparisons performed in a particular merge sort algorithm.
My question is, what counts as a comparison?
If I have a set of numbers say, [29, 11, 16, 12]
Does it count as a comparison when I split it up into [29, 11] and [16, 12] or is it just when I'm comparing [29] and [11] or [16] and [12] etc.?
A split is not a comparison. A comparison is a use of the < or > operators.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks