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
Printable View
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
" " 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
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
" " 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 :)
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