当前位置 : 主页 > 手机开发 > harmonyos >

leetcode707-Design Linked List

来源:互联网 收集:自由互联 发布时间:2023-08-26
1st time to do this kind of problem, so it is hard to handle. Error: Do not know how to design. 1) need to create another node to represent the “Node” 2) use this node to handle Need to think of edge cases: e.g. 1) when index == 2 and s


1st time to do this kind of problem, so it is hard to handle.

Error:

  1. Do not know how to design. 1) need to create another node to represent the “Node” 2) use this node to handle
  2. Need to think of edge cases: e.g. 1) when index == 2 and size == 2 in insert and delete 2) when insert at head, tail 3) when delete at head, tail
  3. I think it is good to use 3 variables: head, tail, and size


上一篇:leetcode-154-Find Minimum in Rotated Sorted Array II
下一篇:没有了
网友评论