Fold Of Linkedlist
Given a singly linkedlist : l0 -> l1 -> l2 -> l3 -> l4 -> l5 -> l6 ..... -> ln-1 -> lnInput Format
reorder it : l0 -> ln -> l1 -> ln-1 -> l2 -> ln-2 -> l3 -> ln-3 -> .....
for more information watch video.
1->2->3->4->5->6->7->nullOutput Format
1->7->2->6->3->5->4->nullQuestion Video
0 <= N <= 10^6Sample Input
10Sample Output
5
1
4
6
9
9
6
4
1
5
5 5 1 1 4 4 6 6 9 9
-
Asked in Companies
-
Related Topics
Video Solution
Code Solution
{ }
{ }
Run