Results 1 to 3 of 3

Thread: Reorder List Problem (Interview Question)

  1. #1

    Thread Starter
    Registered User
    Join Date
    Oct 2018
    Posts
    1

    Reorder List Problem (Interview Question)

    Hi,

    Can someone help me to solve this question asked in microsoft interview from Interviewbit.

    Code:
    Given a singly linked list
    
        L: L0 → L1 → … → Ln-1 → Ln,
    reorder it to:
    
        L0 → Ln → L1 → Ln-1 → L2 → Ln-2 → …
    You must do this in-place without altering the nodes’ values.
    
    For example,
    Given {1,2,3,4}, reorder it to {1,4,2,3}.
    Any pointers will do help.

    Thanks.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: Reorder List Problem (Interview Question)

    The CodeBank forums are for sharing working code snippets, not for asking questions. I have asked the mods to move this thread to the C# forum. Please don't create a duplicate thread in the meantime.

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: Reorder List Problem (Interview Question)

    As for the question, have you made any attempt at all? Have you at least tried to develop an algorithm, even if not code to implement it?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width