It's from my homework assignment
Based on the O notation, approximately how many swaps and comparisons occur when Selection sort is called on a worst-case array of length 8?
Number of swaps = O(n) which is "8" and
Number of comparison = O(n^2) which is "64".
I'm little bit counfused of what the question is asking??? am I suppose to choose more than one answer??
Approximately how many swaps and comparisons occur when Merge Sort is called on a worst-case array of length 8?
Number of swaps = O(N log N) or Log2 N which is "3" i think
Number of comparison O(N log N)or Log2 N
Can anybody show me to how to find swaps and comparisons for selection sort & merge sort..please.