Add to Chrome
✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
Команди,які вставляють новий елемент в кінець кільцевого однонапрямленого списку
Команди,
які вставляють новий елемент в кінець кільцевого однонапрямленого списку
Elem *tmp = new Elem;
tmp->info = value;
tmp->link = NULL;
if (last !=NULL)
if (last !=
NULL)
last->link = tmp;
last = tmp;
if (first== NULL)
if (first
== NULL)
first = tmp;
Elem*tmp = new Elem;
Elem
*tmp = new Elem;
tmp->info = V2;
tmp->prev = L->prev;
tmp->next = L;
L->prev = tmp;
L = tmp;
tmp->next = NULL;
last->next = tmp;
tmp->prev = last;
if (L != NULL)
{
Elem*T = L;
*T = L;
while(T->link != L)
while
(T->link != L)
T = T->link;
T->link = tmp;
}
else
tmp->link = L;
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!