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:
- 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 size == 2 in insert and delete 2) when insert at head, tail 3) when delete at head, tail
- I think it is good to use 3 variables: head, tail, and size