YOU THERE! SHOW ME HOW YOU DELETE AN ENTRY FROM A LINKED LIST OR ELSE I'LL SHOOT YOU WAIFU!
>>57642097
Not doing your homework nigger. You even stole that image didn't you?
>>57642097
go back to school nigger
current->previous->next = current->next
current->next->previous = current->previous
whatever unlinks current in your language
>>57642097doggu_list = [[1, 2, 3][3, 2, 1]]
doggu_list[0].pop(0)
doggu_list[1].pop(1)
that's in python.
kinda drunk and on my phone but anything for misato-san
NodePtr pred;
NodePtr cur;
pred = new NodeType;
cur = head;
while(cur != NULL && cur->data != key)
{
pred = cur;
cur = cur->next;
}
if(cur != NULL)
{
pred->next = cur->next;
delete cur;
}
>>57642097(remove item list)
>>57642500
>used goods
good luck with that
list.next();
list.remove();
>>57642097
joke's on you i'm not an animufag
Do it like Linus tells you to do. Unless you have bad taste.
>>57643015
I want to marry Nui.
>>57642097
>implying
She will kick your ass
Alright nigger.
First you reach your to-be-deleted node with your lookup node logic, call it currentNode.
Assign the currentNode's previous node's next field to the currentNode's next field. Assign the currentNode's next node's previous field to the currentNode's previous field.
That's it really. If you have to manage memory you can free your node now.
i don't rmeember lol
>>57642097
easystruct Node {
next: Option<Box<Node>>
}
impl Node {
fn remove_next(&mut self) {
let mut next: Option<Box<Node>> = None;
swap(&mut next, &mut self.next);
if let Some(mut next) = next {
swap(&mut self.next, &mut next.next);
}
}
}