Deleting a middle node from a single linked list when pointer to the previous node is not available

前端 未结 24 1391
陌清茗
陌清茗 2020-11-29 20:42

Is it possible to delete a middle node in the single linked list when the only information available we have is the pointer to the node to be deleted and not the pointer to

24条回答
  •  天涯浪人
    2020-11-29 20:52

    Maybe do a soft delete? (i.e., set a "deleted" flag on the node) You can clean up the list later if you need to.

提交回复
热议问题