Google Search Box

自訂搜尋

Friday, April 2, 2010

Re: [課業] 資料結構/circular queue

作者: hetea (hetea) 看板: Examination
標題: Re: [課業] 資料結構/circular queue
時間: Fri Apr 2 21:13:32 2010

※ 引述《lena80379 (小豆芽)》之銘言:
: ※ 引述《shorttime (鄉民)》之銘言:
: : 1.考試科目: 資料結構
: : 2.章節名稱or篇名(單元關鍵字):
: : 第四章 circular queue的部份
: : 3.目前參考用書or考古題出處:
: : 資料結構 蔡定遠/著
: : 4.想問的內容:
: : Let a circular queue occupy a block of continuous locations in memory,
: : where F and L are pointers to the first and the last locations respectively.
: : Let H and T be pointers to the head and tail of the circular queue.
: : Which of the following statement is false ?
: : (A) if H = T,then the queue is empty.
: : (B) if H = T,then the queue is full.
: : (C) if H = L now, then H will equal to F after removing an element from queue.
: : (D) if T = L now, then T will equal to F after adding an element.
: : 答案是:B
: 我的問題與原po不同
: (C)(D)沒有問題 想問的是(A)(B)
: (一)在實作上
: ┌┬┬┬┐
: └┴┴┴┘
: ↑ ↑
: front rear
: 那在front=rear時, queue有可能是empty也有可能是full
: (initial時, front=rear, empty)
: (full時front=rear)
: (二)在定義上
: ┌┬┬┬┐
: └┴┴┴┘
: ↑ ↑
: front rear
: 在front=rear時, queue可能empty或有一個item
: (initial時, front=rear, empty)
:





No comments:

Post a Comment