You are viewing a single comment's thread. Return to all comments →
def atNodeFromTail(head,position): cur = head stack = [] while cur != None: stack.append(cur.data) cur = cur.next return stack[-position-1]
Simple Solution with O(N) complexity
Seems like cookies are disabled on this browser, please enable them to open this website
Get Node Value
You are viewing a single comment's thread. Return to all comments →
Simple Solution with O(N) complexity