Examveda

The algorithm given is for deleting an element in an unrolled linked list. What should be the correct statement for the blank given below?
Find an element in node a
    a.data.delete(element)
    a.elementNum--
    while a.elementNum < a.data.size / 2
        put element from a.next.data in a.data
        a.next.elementNum--
        a.elementNum++
    if a.next.elementNum < a.next.data.size / 2
         _______________________
         _______________________

A.

merge nodes a and a.next
    delete node a.next

B.

delete node a
    merge nodes a.prev and a.next

C.

a.elementNum--
    a.elementNum++

D.

a.next.elementNum--
    a.next.elementNum++

Answer: Option A


This Question Belongs to Data Structure >> Linked Lists In Data Structures

Join The Discussion

Related Questions on Linked Lists in Data Structures

What is a circular linked list?

A. A list where each node points to the next

B. A list where the last node points to the first node

C. A list where each node points to itself

D. A list where the nodes are in a circle