我遇到了一个有趣的问题,但是对于给我的答案感到困惑。问题如下:
The concatenation of 2 lists can be performed O(1) time.
Which of the following implementation of list should be used?
- Singly Linked List
- Doubly Linked List
- Circular Linked List
- Array Implementation Of Linked List
我最初认为DLL是正确的选择,因为连接可以从两侧发生,但答案似乎是CLL。 我很困惑。 任何解释都将非常有帮助。 谢谢。