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

An elevator went up 15 floors, down 9 floors, up 11 floors, and down 19 floors. Find the net change. Show work using a number line.
The United States became directly involved in World War II following a. Germany's attack on Britain. b. the German invasion of Poland. c. Japan's attack on P
164.35 in expanded form
Jill enjoys reading about American history, especially the last 40 years, or four _____________, of the nineteenth century. a. centuries b. millennia c. deca
all moving objects have energy of
Which two heat illnesses feature cramps as one of the symptoms?
how do you write 12/75 as a decimal
What is 5/6 in lowest terms
how would -465 be classified
Which phrase refers to the contrast between what is expected to happen and what actually does happen? situational irony dramatic irony verbal irony conflict and