i*p
2 楼
It seems impossible to remove a node (and its memory) from a doubly (bi-directions) linked list without a temp variable to help.
Request:
Don't lose the pointer to the list.
Your comments.
Request:
Don't lose the pointer to the list.
Your comments.
w*s
3 楼
WellPet LLC, in cooperation with the U.S. Food & Drug Administration
(FDA), is voluntarily recalling certain lots of Wellness
canned cat food.
The recall lots involved in this voluntary recall are:
Wellness Canned Cat Food (all flavors and sizes) with best by dates
from 14APR 13 through 30SEP13; Wellness Canned Cat Food Chicken &
Herring (all sizes) with 10NOV13 or 17NOV13 best buy dates. A full
listing of recalled lots can be found in the FDA recall bulletin at:
http://www.fda.gov/Safety/Recalls/ucm245108.htm
Recent laboratory testing found that the recalled lots might contain
less than adequate levels of thiamine, which can lead to a thiamine
deficiency if consumed regularly by cats. Symptoms of deficiency
displayed by an affected cat can be gastrointestinal or neurological in
nature. If your cat has consumed the recalled lots and has these
symptoms, please contact your veterinarian.
Customers who still have cans of cat food from these lots are advised to
stop feeding them to their cats and call WellPet at (877) 227-9587
Monday through Friday, 9:00 am – 7:00 pm Eastern Time. Consumers with
further questions should visit www.wellnesspetfood.com
If you purchased this item for someone else, please notify the recipient
immediately and provide them with the information in the FDA bulletin
concerning these safety issues.
(FDA), is voluntarily recalling certain lots of Wellness
canned cat food.
The recall lots involved in this voluntary recall are:
Wellness Canned Cat Food (all flavors and sizes) with best by dates
from 14APR 13 through 30SEP13; Wellness Canned Cat Food Chicken &
Herring (all sizes) with 10NOV13 or 17NOV13 best buy dates. A full
listing of recalled lots can be found in the FDA recall bulletin at:
http://www.fda.gov/Safety/Recalls/ucm245108.htm
Recent laboratory testing found that the recalled lots might contain
less than adequate levels of thiamine, which can lead to a thiamine
deficiency if consumed regularly by cats. Symptoms of deficiency
displayed by an affected cat can be gastrointestinal or neurological in
nature. If your cat has consumed the recalled lots and has these
symptoms, please contact your veterinarian.
Customers who still have cans of cat food from these lots are advised to
stop feeding them to their cats and call WellPet at (877) 227-9587
Monday through Friday, 9:00 am – 7:00 pm Eastern Time. Consumers with
further questions should visit www.wellnesspetfood.com
If you purchased this item for someone else, please notify the recipient
immediately and provide them with the information in the FDA bulletin
concerning these safety issues.
h*e
4 楼
可以,只不过没有了那种原生态的鲜味。
x*n
5 楼
node->prev->next = node->next;
node->next->prev = node->prev;
free(node);
node->next->prev = node->prev;
free(node);
i*e
11 楼
Another more interesting problem is to remove a node from a singly linked
list in constant time.
list in constant time.
i*p
13 楼
For example, we are giving a pointer to the node to be removed. Once the
removing is done, the pointer is pointed to null. We lose the reference to
the list.
【在 i**********e 的大作中提到】![](/moin_static193/solenoid/img/up.png)
: No it is correct.
: It only reposition its previous's next and next's prev node.
: the current node still has reference from the pointer.
: However, the solution above did not check for NULL (ie, prev or next node
: might be NULL).
removing is done, the pointer is pointed to null. We lose the reference to
the list.
【在 i**********e 的大作中提到】
![](/moin_static193/solenoid/img/up.png)
: No it is correct.
: It only reposition its previous's next and next's prev node.
: the current node still has reference from the pointer.
: However, the solution above did not check for NULL (ie, prev or next node
: might be NULL).
i*e
18 楼
There should be two nodes referencing the list.
One is the node pointing to the node you want to delete, the other point to
the head of the list.
we
【在 i**p 的大作中提到】![](/moin_static193/solenoid/img/up.png)
: In the beginning the pointer points to the node to be removed. After the
: node is removed, the pointer needs to point some node in the list so that we
: can access the list by the pointer.
One is the node pointing to the node you want to delete, the other point to
the head of the list.
we
【在 i**p 的大作中提到】
![](/moin_static193/solenoid/img/up.png)
: In the beginning the pointer points to the node to be removed. After the
: node is removed, the pointer needs to point some node in the list so that we
: can access the list by the pointer.
i*p
19 楼
OK, let me change the question like this.
A list with 8 nodes is pointed to the head by a pointer. Is it possible to
remove the 3rd node and its memory without any other variable helping?
the list is a doubly bi-direction linked.
to
【在 i**********e 的大作中提到】![](/moin_static193/solenoid/img/up.png)
: There should be two nodes referencing the list.
: One is the node pointing to the node you want to delete, the other point to
: the head of the list.
:
: we
A list with 8 nodes is pointed to the head by a pointer. Is it possible to
remove the 3rd node and its memory without any other variable helping?
the list is a doubly bi-direction linked.
to
【在 i**********e 的大作中提到】
![](/moin_static193/solenoid/img/up.png)
: There should be two nodes referencing the list.
: One is the node pointing to the node you want to delete, the other point to
: the head of the list.
:
: we
l*a
20 楼
1)u want to use this pointer to delete this node
2) u need to adjust its previous node and next node to make sure that
they have no relationship with this node
then u can delete this node
3) after u delete this node use this pointer, how can u let it point to the
others?
now u can't use its pre/next node to delete this node as well.
so what u said is a paradox
we
【在 i**p 的大作中提到】![](/moin_static193/solenoid/img/up.png)
: In the beginning the pointer points to the node to be removed. After the
: node is removed, the pointer needs to point some node in the list so that we
: can access the list by the pointer.
2) u need to adjust its previous node and next node to make sure that
they have no relationship with this node
then u can delete this node
3) after u delete this node use this pointer, how can u let it point to the
others?
now u can't use its pre/next node to delete this node as well.
so what u said is a paradox
we
【在 i**p 的大作中提到】
![](/moin_static193/solenoid/img/up.png)
: In the beginning the pointer points to the node to be removed. After the
: node is removed, the pointer needs to point some node in the list so that we
: can access the list by the pointer.
i*p
21 楼
So you indirectly say "no" to the question.
But I will say it is possible.
the
【在 l*****a 的大作中提到】![](/moin_static193/solenoid/img/up.png)
: 1)u want to use this pointer to delete this node
: 2) u need to adjust its previous node and next node to make sure that
: they have no relationship with this node
: then u can delete this node
: 3) after u delete this node use this pointer, how can u let it point to the
: others?
: now u can't use its pre/next node to delete this node as well.
: so what u said is a paradox
:
: we
But I will say it is possible.
the
【在 l*****a 的大作中提到】
![](/moin_static193/solenoid/img/up.png)
: 1)u want to use this pointer to delete this node
: 2) u need to adjust its previous node and next node to make sure that
: they have no relationship with this node
: then u can delete this node
: 3) after u delete this node use this pointer, how can u let it point to the
: others?
: now u can't use its pre/next node to delete this node as well.
: so what u said is a paradox
:
: we
相关阅读