# Algorithm multiple choice questions part-3

## Algorithm MCQs:-

1. Which sorting algorithm has the best worst-case time complexity? a) Bubble Sort b) Selection Sort c) Insertion Sort d) Merge Sort e) Quick Sort Answer: d) Merge Sort

2. Which sorting algorithm has the best average-case time complexity? a) Bubble Sort b) Selection Sort c) Insertion Sort d) Merge Sort e) Quick Sort Answer: e) Quick Sort

3. Which sorting algorithm has the best best-case time complexity? a) Bubble Sort b) Selection Sort c) Insertion Sort d) Merge Sort e) Quick Sort Answer: c) Insertion Sort

4. What is the minimum number of swaps required in Bubble Sort? a) 0 b) Θ(n) c) Θ(n2) d) O(nlgn) e) Is not in-place sorting Answer: a) 0

5. What is the maximum number of swaps required in Bubble Sort? a) 0 b) Θ(n) c) Θ(n2) d) O(nlgn) e) Is not in-place sorting Answer: c) Θ(n2)

6. What is the minimum number of swaps required in Selection Sort? a) 0 b) Θ(n) c) Θ(n2) d) O(nlgn) e) Is not in-place sorting Answer: a) 0

7. What is the maximum number of swaps required in Selection Sort? a) 0 b) Θ(n) c) Θ(n2) d) O(nlgn) e) Is not in-place sorting Answer: b) Θ(n)

8. What is the minimum number of swaps required in Insertion Sort? a) 0 b) Θ(n) c) Θ(n2) d) O(nlgn) e) Is not in-place sorting Answer: a) 0

9. What is the maximum number of swaps required in Insertion Sort? a) 0 b) Θ(n) c) Θ(n2) d) O(nlgn) e) Is not in-place sorting Answer: c) Θ(n2)

10. What is the minimum number of swaps required in Quick Sort? a) 0 b) Θ(n) c) Θ(n2) d) O(nlgn) e) Is not in-place sorting Answer: a) 0

11. What is the maximum number of swaps required in Quick Sort? a) 0 b) Θ(n) c) Θ(n2) d) O(nlgn) e) Is not in-place sorting Answer: c) Θ(n2)

12. Which sorting algorithm is not an in-place sorting algorithm? a) Bubble Sort b) Selection Sort c) Insertion Sort d) Merge Sort e) Quick Sort Answer: d) Merge Sort

13. What is the time complexity of Linear Search in the worst case? a) Θ(n) b) Θ(n2) c) Θ(nlgn) d) O(n) e) O(logn) Answer: a) Θ(n)

14. What is the time complexity of Linear Search in the average case? a) Θ(n) b) Θ(n2) c) Θ(nlgn) d) O(n) e) O(logn) Answer: a) Θ(n)

Pre  👈                                👉  Next
{"ft_lang_label":"__label__en","ft_lang_prob":0.51597995,"math_prob":0.9549836,"size":2867,"snap":"2023-40-2023-50","text_gpt3_token_len":985,"char_repetition_ratio":0.16486204,"word_repetition_ratio":0.6113281,"special_character_ratio":0.29891872,"punctuation_ratio":0.0513245,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9992995,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-12-01T01:20:09Z\",\"WARC-Record-ID\":\"<urn:uuid:daaa91ab-3490-43cb-8762-17e19742b83a>\",\"Content-Length\":\"175190\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:2a7c0134-a693-4895-91dc-da1aee75463d>\",\"WARC-Concurrent-To\":\"<urn:uuid:205dac89-158c-4cb1-8979-eb4025a473cd>\",\"WARC-IP-Address\":\"172.253.115.121\",\"WARC-Target-URI\":\"https://www.easycodingzone.com/2023/04/algorithm-multiple-choice-questions_0.html\",\"WARC-Payload-Digest\":\"sha1:GUHRZMGHDJCPA5NOZP5D7LGUHLA3KVIB\",\"WARC-Block-Digest\":\"sha1:RNQNLO6QVUJ4HH5LIWJMRA7MNI75NZ3T\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-50/CC-MAIN-2023-50_segments_1700679100258.29_warc_CC-MAIN-20231130225634-20231201015634-00168.warc.gz\"}"}