小杨用单链表保存任务序列,并同时维护头指针 head 和尾指针 tail。在链表非空且已知 tail 的情况
下,在表尾插入新结点的时间复杂度是( )。
struct Node { int value; Node *next; }; Node *head; Node *tail;小杨用单链表保存任务序列,并同时维护头指针 head 和尾指针 tail。在链表非空且已知 tail 的情况
下,在表尾插入新结点的时间复杂度是( )。
struct Node { int value; Node *next; }; Node *head; Node *tail;