DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Sort Qst For Strongest in C++

Hybrid View

  1. #1
    Guest

    Sort Qst For Strongest in C++



    Hi everybody! (Ms. Kalev, I know you had to see this)

    Please tell me if you could sort an array on integers if you
    were required to go thru the array only one time.

    Thank you,
    Sam

  2. #2
    Danny Kalev Guest

    Re: Sort Qst For Strongest in C++



    " " wrote:
    >
    > Hi everybody! (Ms. Kalev, I know you had to see this)
    >
    > Please tell me if you could sort an array on integers if you
    > were required to go thru the array only one time.

    yes.

    It's mr. Kalev, btw

    Danny

  3. #3
    jonnin Guest

    Re: Sort Qst For Strongest in C++


    Yes. You could, but very inefficiently. What are the full rules? can you
    swap adjacent values, far apart values, or what?
    Is this a linked list or something? Post a better set of requirements /
    rules and I'll help you pick a method. (If you can only access one value
    at a time (no swaps) and you cannot have a second array(or some vars) for
    storage, then the answer is no)


    " " wrote:
    >
    >
    >Hi everybody! (Ms. Kalev, I know you had to see this)
    >
    >Please tell me if you could sort an array on integers if you
    >were required to go thru the array only one time.
    >
    >Thank you,
    > Sam



  4. #4
    GJetson Guest

    Re: Sort Qst For Strongest in C++


    " " wrote:
    >
    >
    >Hi everybody! (Ms. Kalev, I know you had to see this)
    >
    >Please tell me if you could sort an array on integers if you
    >were required to go thru the array only one time.
    >
    >Thank you,
    > Sam


    When I first interviewed with Microsoft, they asked this exact question...
    I gave them my solution, and they wanted a solution that used less memory.
    So I gave em that... Then they wanted a solution that was just as efficient
    as my first implimentation. After a minute of head scratching, and a gesture
    from the interviewer, I figured it out... Then he wanted me to impliment
    my pseudo-code into c++ code... Most greuling interviewing process I've been
    through in my life... (Just imagine a whole day of questions like this) But
    at least I survived :)


  5. #5
    Guest

    Re: Sort Qst For Strongest in C++



    Looks like you don't know the answer..Mr. Kalev :)


    Danny Kalev <dannykk@inter.net.il> wrote:
    >
    >
    >" " wrote:
    >>
    >> Hi everybody! (Ms. Kalev, I know you had to see this)
    >>
    >> Please tell me if you could sort an array on integers if you
    >> were required to go thru the array only one time.

    >yes.
    >
    >It's mr. Kalev, btw
    >
    >Danny



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center