Practice Exam 1 Corrections
These are my Practice Exam 1 Corrections.
Reason B is correct: This code segment moves the robot forward two squares, rotates it right three times so that the robot faces the top of the grid, and then moves the robot forward three squares to the gray square. Reason B is correct: Redundant routing is impossible if there is only one possible path from one device to another. There is only one possible path from P to S (P to R to Q to S). Reason C is correct: The transformation is lossless because an encoded string can be restored to its original version. For example, “%##%E_BEST_W#H” can be restored to “THIS_IS_YOUR_BEST_WISH” by replacing all instances of “%” with “TH and by replacing all instances of “IS”. Reason A is correct: This code segment rotates right whenever there is an open square to the right. The robot will move forward from its initial location to the upper-left corner of the grid, then rotate right, then move forward to the upper-right corner of the grid, then rotate right, then move down two squares, then rotate right, then move forward to the gray square.