Tasks •https://www.hackerrank.com/challenges/detect-whether-a-linked-list-contains-a-cycle/problem •https://www.hackerrank.com/challenges/sparse-arrays/problem •https://www.hackerrank.com/challenges/tree-huffman-decoding/problem •https://www.hackerrank.com/challenges/queue-using-two-stacks/problem •https://www.hackerrank.com/challenges/self-driving-bus/problem
Find the middle of a given linked list in C# or Java
Given a singly linked list, find the middle of the linked list. For example, if given linked list is 1->2->3->4->5 then output should be 3.
If there are even nodes, then there would be two middle nodes, we need to print the second middle element. For example, if given linked list is 1->2->3->4->5->6 then output should be 4.