Inserting a node into a linked list in constant-time?

前端 未结 7 1018
别跟我提以往
别跟我提以往 2021-01-24 09:09

I\'m working on an assignment that is telling me to assume that I have a singly linked list with a header and tail nodes. It wants me to insert an item y before position p. Ca

7条回答
  •  情书的邮戳
    2021-01-24 09:55

    How about using code that is already there? LinkedHashMap, LinkedList, LinkedHashSet. You can also check out the code and learn from it.

提交回复
热议问题