CS 1332 Exam 3 Big O Flash Cards
(Pattern-Matching Sorting Algos) Questions
With Correct Answers
Best |case |for |Bubble |sort |- |CORRECT |ANSWER✔✔-O(n)
Average |Case |for |Bubble |Sort |- |CORRECT |ANSWER✔✔-O(n^2)
Worst |Case |for |Bubble |Sort |- |CORRECT |ANSWER✔✔-O(n^2)
Is |Bubble |Sort |'Stable'? |- |CORRECT |ANSWER✔✔-Yes. |It |is |stable.
Is |Bubble |Sort |'Adaptive'? |- |CORRECT |ANSWER✔✔-Yes. |It |is |adaptive.
Bubble |Sort |is |In-Place |or |Out-Place? |- |CORRECT |ANSWER✔✔-In-Place.
Best |Case |for |Insertion |Sort |- |CORRECT |ANSWER✔✔-O(n)
Average |Case |for |Insertion |Sort |- |CORRECT |ANSWER✔✔-O(n^2)
Worst |Case |for |Insertion |Sort |- |CORRECT |ANSWER✔✔-O(n^2)
Is |insertion |sort |stable? |- |CORRECT |ANSWER✔✔-Yes.
, Is |Insertion |Sort |Adaptive? |- |CORRECT |ANSWER✔✔-Yes.
Is |Insertion |Sort |In-Place? |- |CORRECT |ANSWER✔✔-Yes. |In-Place
Best |Case |for |Selection |Sort |- |CORRECT |ANSWER✔✔-O(n^2)
Average |Case |for |Selection |Sort |- |CORRECT |ANSWER✔✔-O(n^2)
Worst |Case |for |Selection |Sort |- |CORRECT |ANSWER✔✔-O(n^2)
Is |Selection |Sort |Stable? |- |CORRECT |ANSWER✔✔-No. |Un-stable.
Is |Selection |Sort |Adaptive? |- |CORRECT |ANSWER✔✔-No. |Un-adaptive.
Is |Selection |Sort |In-place? |- |CORRECT |ANSWER✔✔-Yes. |In-Place.
Best |Case |for |Cocktail |Shaker |Sort |- |CORRECT |ANSWER✔✔-O(n)
Average |Case |for |Cocktail |Shaker |Sort |- |CORRECT |ANSWER✔✔-O(n^2)
Worst |Case |for |Cocktail |Shaker |Sort |- |CORRECT |ANSWER✔✔-O(n^2)
Is |Cocktail |Shaker |Sort |Stable? |- |CORRECT |ANSWER✔✔-Yes. |It |is |Stable.
Is |Cocktail |Shaker |Sort |Adaptive? |- |CORRECT |ANSWER✔✔-Yes. |It |is |Adaptive.
(Pattern-Matching Sorting Algos) Questions
With Correct Answers
Best |case |for |Bubble |sort |- |CORRECT |ANSWER✔✔-O(n)
Average |Case |for |Bubble |Sort |- |CORRECT |ANSWER✔✔-O(n^2)
Worst |Case |for |Bubble |Sort |- |CORRECT |ANSWER✔✔-O(n^2)
Is |Bubble |Sort |'Stable'? |- |CORRECT |ANSWER✔✔-Yes. |It |is |stable.
Is |Bubble |Sort |'Adaptive'? |- |CORRECT |ANSWER✔✔-Yes. |It |is |adaptive.
Bubble |Sort |is |In-Place |or |Out-Place? |- |CORRECT |ANSWER✔✔-In-Place.
Best |Case |for |Insertion |Sort |- |CORRECT |ANSWER✔✔-O(n)
Average |Case |for |Insertion |Sort |- |CORRECT |ANSWER✔✔-O(n^2)
Worst |Case |for |Insertion |Sort |- |CORRECT |ANSWER✔✔-O(n^2)
Is |insertion |sort |stable? |- |CORRECT |ANSWER✔✔-Yes.
, Is |Insertion |Sort |Adaptive? |- |CORRECT |ANSWER✔✔-Yes.
Is |Insertion |Sort |In-Place? |- |CORRECT |ANSWER✔✔-Yes. |In-Place
Best |Case |for |Selection |Sort |- |CORRECT |ANSWER✔✔-O(n^2)
Average |Case |for |Selection |Sort |- |CORRECT |ANSWER✔✔-O(n^2)
Worst |Case |for |Selection |Sort |- |CORRECT |ANSWER✔✔-O(n^2)
Is |Selection |Sort |Stable? |- |CORRECT |ANSWER✔✔-No. |Un-stable.
Is |Selection |Sort |Adaptive? |- |CORRECT |ANSWER✔✔-No. |Un-adaptive.
Is |Selection |Sort |In-place? |- |CORRECT |ANSWER✔✔-Yes. |In-Place.
Best |Case |for |Cocktail |Shaker |Sort |- |CORRECT |ANSWER✔✔-O(n)
Average |Case |for |Cocktail |Shaker |Sort |- |CORRECT |ANSWER✔✔-O(n^2)
Worst |Case |for |Cocktail |Shaker |Sort |- |CORRECT |ANSWER✔✔-O(n^2)
Is |Cocktail |Shaker |Sort |Stable? |- |CORRECT |ANSWER✔✔-Yes. |It |is |Stable.
Is |Cocktail |Shaker |Sort |Adaptive? |- |CORRECT |ANSWER✔✔-Yes. |It |is |Adaptive.