10. For a doubly-linked list class, each of its nodes has two links left and right to its two neighboring nodes. Assume that we want to implement a member function ShiftRight, which takes an input x, a pointer to a node, and swaps that node with the node to its right. Let us further assume that neither xx nor the node to its right is the first or the last node of the list. There are six pointers to be set, and the statements, labeled s1 to s6, are listed in the box below. Which of the following ordering of these statements will produce the correct behavior?

(A)s5→s2→s6→s1→s4→s3
(B)s2→s5→s4→s3→s1→s6
(C)s4→s3→s6→s1→s2→s5
(D)s1→s2→s3→s6→s5→s4
(E)s4→s5→s3→s6→s1→s2

答案:登入後查看
統計: 尚無統計資料

詳解 (共 1 筆)

#7102399
1. 題目解析 在這道題目中,我們需要...
(共 1053 字,隱藏中)
前往觀看
0
0