Just in case other students come looking for an answer to this question, here's an idea...
We'll use a multi-tape TM just to make this as painless as possible. Let one of your extra tapes be the queue you want to implement. To add something to the queue, move right until you hit a blank square, then add your symbol to the queue. To remove something from the queue, move to the left until you hit a blank (assuming this tape starts with a single blank square), move right, and remove what's on the tape and put a blank in its place. So, starting with a blank queue where D is blank and tape alphabet is abc, here's how the following transaction sequence would look:
发布评论
评论(1)
以防万一其他学生来寻找这个问题的答案,这里有一个想法......
我们将使用多磁带 TM 来使这尽可能轻松。让您的额外磁带之一成为您想要实现的队列。要将某些内容添加到队列中,请向右移动,直到遇到空白方块,然后将符号添加到队列中。要从队列中删除某些内容,请向左移动直到遇到空白(假设该磁带以单个空白方块开头),然后向右移动并删除磁带上的内容并在其位置放置一个空白。因此,从一个空白队列开始,其中 D 为空,磁带字母表为 abc,以下是以下事务序列的外观:
这是 TM 在队列磁带上的跟踪:
Just in case other students come looking for an answer to this question, here's an idea...
We'll use a multi-tape TM just to make this as painless as possible. Let one of your extra tapes be the queue you want to implement. To add something to the queue, move right until you hit a blank square, then add your symbol to the queue. To remove something from the queue, move to the left until you hit a blank (assuming this tape starts with a single blank square), move right, and remove what's on the tape and put a blank in its place. So, starting with a blank queue where D is blank and tape alphabet is abc, here's how the following transaction sequence would look:
Here's the trace of the TM on the queue tape: