You are viewing a single comment's thread. Return to all comments →
Nice approach. But, we dont need current pointer here. This solution works without that. Python code (same approach)
def GetNode(head, position): index = 0 result = head while(head.next != None): head = head.next index += 1 if(index > position): result = result.next return result.data
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 →
Nice approach. But, we dont need current pointer here. This solution works without that.
Python code (same approach)