Home | Create Task Project | Data Structures Project | Test Prep | Create Task (NEW) | Study Plan/Reflection |
Finals - Quiz 3
Score: 41/50
Corrections
6. D and A) This algorithm displays the numbers 1, 2, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17, 19, and 20. After 20 is displayed, the algorithm terminates. Option B algorithm displays the numbers 0, 3, 6, 9, 12, 15, and 18.
8. D) This algorithm selects 1 student from the group of 30 students, then selects another student from the remaining 29 students. Any possible pair of students is equally likely to be selected. With option B, it is possible that the same student will be selected twice instead of 2 different students being selected.
18. C) The procedure traverses this list and eventually encounters the positive value 1. At this point, the procedure returns true when it should return false because the list does not contain only positive values. With option D, the procedure begins to traverse the list and immediately encounters the positive value 1. At this point, the procedure returns true as intended for this list.
34. B) As this algorithm has a factorial efficiency, it does not run in a reasonable amount of time. A heuristic approach can be used to find an approximate solution than can run in a reasonable amount of time. With option C, the algorithm has linear efficiency, so it runs in a reasonable amount of time. Therefore, a heuristic is not appropriate.
38. B) A no-rights-reserved Creative Commons license is used when the creator of a published work wants the work to be made freely available to everyone. Publishing an e-book with a no-rights-reserved Creative Commons license enables people to freely make use of its content.
41. D) In public cryptography, a message is encrypted with a recipient’s public key and decrypted with the recipient’s private key. The sender’s public key cannot be used to decrypt the message.
42. 7) 7 bits allows for 128 items. 8 bits allows for 256 items. However, that many slots is not needed.
44. D) The procedures square and cube are each used to determine a power of n. Option B does not generalize the functionality of the procedure.
46. B) This is an example of symmetric encryption because the secret key is used for both encryption and decryption of messages. Option C does not encrypt messages, it only hides them in a secret location.