Question: Problem 3 : ( 8 points total. Show all work for partial credit - use the back of this page as needed. ) Tags labeled
Problem : points total. Show all work for partial credit use the back of this page as needed.
Tags labeled with distinct ID#s are stored in bins. The ID#s are sorted in ascending order.
table Bin#dots,Tag ID #dots,
A robot searches the bins for a target tag ID# using the following algorithm.
Step : Set k to
Step : Move right by bins.
Step : Pick up current tag.
Step : Compare current tag ID# to target ID#
Step : If target ID# is equal to current tag ID#:
Turn on light to indicate that target was found. Stop.
comment: Else continue on to Step
Step : Put back the current tag.
Step : Replace k with k
Step : If target ID# is less than current tag ID#:
Move left by bins
Else if target ID# is more than current tag ID#:
Move right by bins
Repeat from Step
a How many Steps are needed if the target tag ID# is equal to the tag ID# in Bin
b What is the maximum number of Steps needed for the robot to find a target tag in the bins? Give an example of a position that uses that maximum number of steps.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
