GeeksforGeeks » Interview Questions

write program for following?

(4 posts)

Tags:

  1. vivekpandian
    Member
    Posted 6 months ago #

    1 given a linked list 1 2 3 4 5 6 7 8 9 . if given an input 3 u hav to sort it like 7 8 9 4 5 6 1 2 3. in given 2 u hav to sort it like 8 9 6 7 4 5 2 3 1 0.

  2. kartik
    Moderator
    Posted 6 months ago #

    1) Use the method discussed @ http://www.geeksforgeeks.org/archives/8014
    2) Reverse the list obtained after step 1. See http://www.geeksforgeeks.org/archives/860 for reversing the list

  3. kiran
    guest
    Posted 6 months ago #

    Can you be more specific about the input and output for case 2 ?? I can not understand the output
    8 9 6 7 4 5 2 3 1 0 from where did that '0' come ?? Is it in the input list ??

  4. vivekpandian
    Member
    Posted 6 months ago #

    @karthik:tanq:)


Reply

You must log in to post.

RSS feed for this topic