372 B
372 B
category | title |
---|---|
ds | Linked Lists |
Linked Lists
Finding nth node from beginning and nth node from end
Use two pointer approach to avoid extra space. Initialize the kth_node_from_end
pointer when the tmp
pointer reaches kth
node and keep incrementing from there on.