試卷名稱:112年 - 112 學士後醫學系招生考試試題:計算機概論與程式設計#137106
年份:112年
科目:【阿摩】未分類題庫
19. Given the head of a linked list, determine whether the linked list has a cycle. If it does have a cycle, return true; otherwise, return false. The example and algorithm are shown below.
Which of the followings should be "Q1" and "Q2" in the algorithm?
(A) Q1: a = a -> next; Q2: b = b -> next;
(B) Q1: a = b; Q2: b = b -> next;
(C) Q1: a = a -> next; Q2: b = b -> next;
(D) Q1: a = a -> next -> next; Q2: b = b -> next;
(E) Q1: a = a -> next; Q2: b = b -> next -> next;