{"comment":{"url":"https://api.github.com/repos/ArjunMac/InterviewPreparation/comments/19486451","html_url":"https://github.com/ArjunMac/InterviewPreparation/commit/43ac4b1e9ba084284a2f32b907fbefeeef5ee8de#commitcomment-19486451","id":19486451,"user":{"login":"ArjunMac","id":16522584,"avatar_url":"https://avatars.githubusercontent.com/u/16522584?v=3","gravatar_id":"","url":"https://api.github.com/users/ArjunMac","html_url":"https://github.com/ArjunMac","followers_url":"https://api.github.com/users/ArjunMac/followers","following_url":"https://api.github.com/users/ArjunMac/following{/other_user}","gists_url":"https://api.github.com/users/ArjunMac/gists{/gist_id}","starred_url":"https://api.github.com/users/ArjunMac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArjunMac/subscriptions","organizations_url":"https://api.github.com/users/ArjunMac/orgs","repos_url":"https://api.github.com/users/ArjunMac/repos","events_url":"https://api.github.com/users/ArjunMac/events{/privacy}","received_events_url":"https://api.github.com/users/ArjunMac/received_events","type":"User","site_admin":false},"position":null,"line":null,"path":null,"commit_id":"43ac4b1e9ba084284a2f32b907fbefeeef5ee8de","created_at":"2016-10-19T15:14:16Z","updated_at":"2016-10-19T15:14:16Z","body":"Given a singly linked list, find middle of the linked list. For example, if given linked list is 1->2->3->4->5 then output should be 3.\r\n\r\nIf there are even nodes, then there would be two middle nodes, we need to print second middle element. For example, if given linked list is 1->2->3->4->5->6 then output should be 4.\r\n\r\nWe strongly recommend that you click here and practice it, before moving on to the solution.\r\n\r\nMethod 1:\r\nTraverse the whole linked list and count the no. of nodes. Now traverse the list again till count/2 and return the node at count/2.\r\n\r\nMethod 2:\r\nTraverse linked list using two pointers. Move one pointer by one and other pointer by two. When the fast pointer reaches end slow pointer will reach middle of the linked list."}}
{"actor":{"display_login":"ArjunMac"}}