alext1899 alext1899
  • 19-07-2019
  • Computers and Technology
contestada

Deleting anitem from a linked list is best when performed using two pointersso that the deleted item is freed from memory.
a.True
b. False

Respuesta :

ExieFansler ExieFansler
  • 25-07-2019

Answer:

a.True.

Explanation:

To delete a node from linked list it is best to do it by using two pointers suppose say prev and curr. Iterating over the linked list while curr is not NULL and updating prev also.On finding the node to be deleted we will set the prev so that it points to the next of curr and after removing the link we will free curr from memory.

line of code for deleting a node in c++:-

prev->next=curr->next;

delete curr;  or  free(curr);

Answer Link

Otras preguntas

I know the unit rate but don’t know the label.
How much of a spice that is 3% salt should be added to 175 ounces of a spice that is 6% salt in order to make a spice that is 5% salt?
When general semanticists use the expression, "the map is not the territory," to which language barrier are they referring?
While balancing assignments, a project manager must also balance:?
Which equation has the solution x = 5? Select each correct answer. 25x+4=9 18−2x=9 x5+5=6 11 + 6x = 22 32−4x=12 3x + 1 = 9
Witch value is equivalent to 7.2 kilograms? A. 720 grams B. 7,200 grams C. 72,000 grams D. 720 milligrams E. 7,200 milligrams
Evaluate. 33+1⋅9+12 24 30 48 264
Write 2x/3x in simplest form
What is the value for y?
What are some good sources of the human enzyme catalase?