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

Which function is the inverse of ƒ(x) = 4x3 – 2? // its not A
help i’m making brainliest if CORRECT.
In the business world, caring can be demonstrated by.
In what phase of mitosis does the nuclear membrane reform around the nucleus
Complete the table to describe each element of the setting.
What is the total number of atoms in a 30. gram sample of neon?
Since sugar comes from food, which system would directly affect blood sugar levels?
a washer and dryer cost a total of $936. The cost of the washer is two times the cost of the dryer. find the cost of each item
Mrs. Jacobson wants to order toy instruments to give as prizes to her music students. The table shows the prices for various order sizes. 25 Items 50 Items 80
Which set of angle measures could form a triangle? а 25°, 75°, 80° 40 50 60° 45, 35, 90° 100°, 30°, 40°