Microsoft Interview Question
1,274 Interview Reviews |
Back to all Microsoft Interview Questions & Reviews
Interview questions and reviews posted anonymously by interview candidates
Interview Question for Software Engineer at Microsoft:
Helpful Question?
Yes |
No
Inappropriate?
Answers & Comments (2)
template <class T>
void reverse_in_place( T* src_array, size_t count)
{
if (src_array == NULL) return;
if( count <= 1 ) return; //done
typename T * front = &src_array[0];
typename T * back = &src_array[count-1];
while (front != back)
{
std::swap(*front, *back);
front++;
if(front == back) {break; } ;
back--;
}
}
Helpful Answer?
Yes |
No
Inappropriate?
To comment on this
question,
Sign In with Facebook or
Sign Up



1 of 1 people found this helpful
by Interview Candidate: