Tuesday, May 8, 2012

K Reverse a linked list


Q. K-Reverse a linked list.


  • Examples. 
    • Input. (K = 2)   A-->B-->C-->D-->E-->NULL
    • Output (K = 2)  B-->A-->D-->C-->E-->NULL
    • Input. (K = 3)   A-->B-->C-->D-->E-->NULL
    • Output (K = 3)  C-->B-->A-->E-->D-->NULL

This problem is discussed in here

No comments:

Post a Comment