IntelliJ Java IDE
The moose likes Jobs Discussion and the fly likes One array Query--Mohamed Sanaulla this question is frm your blog Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Careers » Jobs Discussion
Reply Bookmark "One array Query--Mohamed Sanaulla this question is frm your blog" Watch "One array Query--Mohamed Sanaulla this question is frm your blog" New topic
Author

One array Query--Mohamed Sanaulla this question is frm your blog

Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 811

Write a function which takes 2 arrays- One array is the source array and the other array is the array of indices and delete all those elements present at the indices of the source array taking the indices from the second array


I didnt get the question. Mohamed Sanaulla needed your help in this


http://www.lifesbizzare.blogspot.com || OCJP:81%
Mohamed Sanaulla
Bartender

Joined: Sep 08, 2007
Posts: 2694

I see the question isnt straight forward as I thought when I wrote it. Let me clear it here:

This is fairly straight forward, but there were some restrictions posed with regards to the complexity and other things which I cant recall (its been almost 3yrs since that question has been asked)


Mohamed Sanaulla | My Blog
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 26720
Did you mean to post that in Jobs Discussion? Henry will probably move this discussion.
What sort of arrays are they? Presumably the indices array is an int[], but is the other array an Object[] or an array of primitives? By remove, I presume you mean replace by null or whichever type of zero is appropriate for this primitive?
I would have thought that is an easy question, and a solution will run in linear time.
Mohamed Sanaulla
Bartender

Joined: Sep 08, 2007
Posts: 2694

I cant recall other things which the interviewer mentioned regarding the question. But surely its an array of ints and also the index array is on int. I think one should be able to find this question among other array based questions for interviews.

 
 
subject: One array Query--Mohamed Sanaulla this question is frm your blog
 
Threads others viewed
Difference between Super and this in Java
toString() behaviour
construct ArrayList from int[]
abstract method
Netbeans & Scala Instillation probs!
developer file tools