java - how to delete a node from linkedlist?

前端 未结 4 674
长发绾君心
长发绾君心 2020-12-11 09:41

This code is a table that has an option to Inert name, delete, show, and quit .

this code run\'s well but my only problem is on how to delete a chosen name in a nod

4条回答
  •  既然无缘
    2020-12-11 10:07

    We could code this for you, but that misses the point.

    Instead, I'm going to suggest that you draw the linked-list data structure on paper using boxes for the list nodes and fields of the nodes, and arrows for the pointers / references. Then draw more boxes for your algorithm's local variables ... and "hand execute" it. That will help you visualize what your code should be doing.

    Once you have done this kind of thing a few times, you will be able to visualize in your head ...


    can you please give me a sample ?

    Sorry, but No. You will learn more by working it out for yourself. See above.

提交回复
热议问题