CS 1332 Sorts Exam Questions With
Correct Answers
in-place |- |CORRECT |ANSWER✔✔-no |separate |data |structures, |only |variables
out-of-place |- |CORRECT |ANSWER✔✔-allocates |space |in |separate |data |structure
stable |- |CORRECT |ANSWER✔✔-relative |order |of |duplicates |remains |the |same
unstable |- |CORRECT |ANSWER✔✔-relative |order |of |duplicates |may |change
which |sorting |algorithm |is |NOT |a |comparison |sort? |- |CORRECT |ANSWER✔✔-radix |sort |
(comparison |sorts |directly |compare |two |items)
bubble |sort |Big |O |- |CORRECT |ANSWER✔✔-O(n^2)
bubble |sort |is |not |adaptive |T/F |- |CORRECT |ANSWER✔✔-F, |bubble |sort |is |adaptive |as |it |will |
stop |when |no |swaps |are |made
insertion |sort |Big |O |- |CORRECT |ANSWER✔✔-O(n^2)
insertion |sort |is |not |adaptive |- |CORRECT |ANSWER✔✔-F, |insertion |sort |is |adaptive |in |that |
when |the |element |is |being |placed |in |the |subarray |it |will |stop |at |the |index |it |belongs |to |(no |
other |swaps |made)
Correct Answers
in-place |- |CORRECT |ANSWER✔✔-no |separate |data |structures, |only |variables
out-of-place |- |CORRECT |ANSWER✔✔-allocates |space |in |separate |data |structure
stable |- |CORRECT |ANSWER✔✔-relative |order |of |duplicates |remains |the |same
unstable |- |CORRECT |ANSWER✔✔-relative |order |of |duplicates |may |change
which |sorting |algorithm |is |NOT |a |comparison |sort? |- |CORRECT |ANSWER✔✔-radix |sort |
(comparison |sorts |directly |compare |two |items)
bubble |sort |Big |O |- |CORRECT |ANSWER✔✔-O(n^2)
bubble |sort |is |not |adaptive |T/F |- |CORRECT |ANSWER✔✔-F, |bubble |sort |is |adaptive |as |it |will |
stop |when |no |swaps |are |made
insertion |sort |Big |O |- |CORRECT |ANSWER✔✔-O(n^2)
insertion |sort |is |not |adaptive |- |CORRECT |ANSWER✔✔-F, |insertion |sort |is |adaptive |in |that |
when |the |element |is |being |placed |in |the |subarray |it |will |stop |at |the |index |it |belongs |to |(no |
other |swaps |made)