Which of the following finds the position of the second character \'g\' in the s
ID: 3823131 • Letter: W
Question
Which of the following finds the position of the second character 'g' in the string word? You can assume word does have at least two Qs in it. a) word [word.find ('Q') + 1;].find('O') + word.find('Q') + 1. b) word [word.find ('Q') + 1;].find('O') + word.find('O') c) word [word.find ('Q');].find('Q') + word.find('Q') Suppose we start with the list {3, 10, 5, 7, 9, 2, 1, 8} After TWO (2) iterations of the selection sort algorithm (as seen in class). what does the list look like? a) [1, 2, 5, 7, 9, 10, 3.8] b) [3, 5, 10, 7, 9, 2, 1, 8] c) [1, 2, 3, 10, 5, 7, 9, 8] Suppose our implementation of a linear search in a list of size 100 has runtime 3 seconds when the target is not found. What is the expected runtime of a search in a list of size 200 when the target is not found? a) about 3 seconds b) about 6 seconds c) about 12 seconds Suppose our implementation of a selection sort takes 3 seconds to sort a list of size What is the expected runtime to sort a list of size 200 ? a) about 3 seconds b) about 6 seconds c) about 12 seconds Which sorting algorithm is best when the list is randomly ordered? a) insertion sort b) selection sort c) mergesort.Explanation / Answer
Sorry for the inconvenience. The picture is not so clear. I will try to answer the questions from the bottom.
50) A. Insertion sort is the best sorting algorithm in this case.
49) The question is unclear. A bit of question got cut off.
48)B. 6 seconds. With increase in list the time also increases
47) a. {1 2 5 7 9 10 3 8}
3 10 5 7 9 2 1 8
1 10 5 7 9 2 3 8 - first litration
1 2 5 7 9 10 3 8 -seond letration
46) question is not clear.
Thank you and sorry for inconvenience
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.