vineetsetia009
- 66
1of 1 vote
Answershow to find a duplicate element in an array without using extra memory....do this in O(n)?
- vineetsetia009 on November 20, 2011 in India Edit | Report Duplicate | Flag
Microsoft Software Engineer / Developer - 19
0of 0 votes
AnswersWrite an algorithm to find an element in an 2D array such that the element should be maximum in the row and minimum in the column?
- vineetsetia009 on November 09, 2011 in India Edit | Report Duplicate | Flag
Microsoft Software Engineer / Developer Algorithm
First of all, I dont have privilege to do that... and I have some cool idea to do that.. If admin wants then i can share with him.
- vineetsetia009 on June 30, 2012 Edit | Flag View Replybut if we delete redundant questions...then we can revise all questions in a small span of time..
- vineetsetia009 on June 30, 2012 Edit | Flag View Replycan you post a main function for this?..thanks in advance
- vineetsetia009 on June 21, 2012 Edit | Flag View ReplyCan anyone explain the test cases?...Thanks in advance.
- vineetsetia009 on June 05, 2012 Edit | Flag View ReplyWe can take a global variable instead of storing each computation.
And the nodes can also be stored in some global variable.
got similar mail from Amazon few days ago..I appeared for intern hiring test, wrote good code...but still got rejected..dont know what the reason behind rejection...
- vineetsetia009 on May 11, 2012 Edit | Flag View Replyextern is used outside.It should be used inside code.
- vineetsetia009 on May 11, 2012 Edit | Flag View Replydude for which position are you applying at Amazon??..Was that telephonic interview or inperson?
- vineetsetia009 on April 28, 2012 Edit | Flag View ReplyHow will you mark the traversal as you are not supposed to do any change in the structure of list...and secondly if you store the lists'node address somewhere, then it will consume a lot of space..
- vineetsetia009 on March 26, 2012 Edit | Flag View ReplyWill someone explain answer of this question?
- vineetsetia009 on February 23, 2012 Edit | Flag View ReplyWill you please explain with an example?
- vineetsetia009 on November 20, 2011 Edit | Flag View Replyyeah...you can consider this..
- vineetsetia009 on November 20, 2011 Edit | Flag View Replyok...thanks
- vineetsetia009 on November 20, 2011 Edit | Flag View ReplyI solved this question by hash map, then they asked me try to solve this in O(1) extra memory.......
- vineetsetia009 on November 20, 2011 Edit | Flag View Replyyou cant use extra space....
- vineetsetia009 on November 20, 2011 Edit | Flag View ReplyCounting sort will consume a lot of space and hash map will consume O(n) space...think apart from this..
- vineetsetia009 on November 20, 2011 Edit | Flag View Replyyeah right..
- vineetsetia009 on November 20, 2011 Edit | Flag View ReplyI think you should compare numbers after calculating..
And for 891.see below
891->191 so neglected
891->898 first answer
891->901 now find for 901 and compare it with 898.
now for 901 next palindrome will be 909 and 898 is smaller than 909 so 898 is the answer.
NO......this is the correct question...if array is incremental then the answer is straight forward..
- vineetsetia009 on November 10, 2011 Edit | Flag View ReplyNo....
- vineetsetia009 on November 10, 2011 Edit | Flag View Replythey asked to optimize this to constant amount of time
- vineetsetia009 on November 10, 2011 Edit | Flag View Reply@anonymous...they asked to do this in constant amount of time..
- vineetsetia009 on November 10, 2011 Edit | Flag View Reply
You can add me on vineetsetia009@gmail.com and we can talk on this.Also if you have contacts to admin then you can suggest that idea to him/her too..
- vineetsetia009 on June 30, 2012 Edit | Flag View Reply