DIR Return Create A Forum - Home
---------------------------------------------------------
techsuns
HTML https://techsuns.createaforum.com
---------------------------------------------------------
*****************************************************
DIR Return to: Puzzles && Algorithms
*****************************************************
#Post#: 353--------------------------------------------------
Microsoft Interview Question
By: srini Date: December 5, 2012, 9:13 am
---------------------------------------------------------
Given a sorted array of size n. Each element in array is unique
and lies from 1 to n+1. Find the missing element?
#Post#: 355--------------------------------------------------
Re: Microsoft Interview Question
By: kranthipls Date: December 5, 2012, 9:29 am
---------------------------------------------------------
Add all the elements and substract it from (n+1)(n+2)/2 which
gives us the missing element
#Post#: 357--------------------------------------------------
Re: Microsoft Interview Question
By: srini Date: December 6, 2012, 9:17 am
---------------------------------------------------------
Exactly :)
*****************************************************