-
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
-
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
-
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
-
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 :)
-
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
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|