Its just implementing the idea of bitset.He asked me to consider only +ve
chars(0 to 127).....I used the first 4 integers(128 bits)   as record
table.I used the individual bits as hash table by mapping each visited char
to Ascii/32 integer and setting the ascii%32 bit as one.The other 4 were
similarly used for visiting table that is mapping the repeated chars as
above.
There was another approach possible that I gave which required only 128 bits
but destroyed original string.I leave it on you to figure it.:)

On Tue, Aug 2, 2011 at 9:49 PM, Ankit <[email protected]> wrote:

> What's the answer to the fifth question,the one about percentage of
> occupancy in a disk ?
>
> On Aug 2, 1:33 pm, Anu <[email protected]> wrote:
> > Microsoft visited our campus today , an advice for everybody preparing
> > for it , make sure you know all the recently asked questions(posted on
> > algogeeks) , they repeat some questions .
> >
> > Written Round:
> > objective round , 30 minutes , 10 questions(easy) .
> > subjective round , 45 minutes , 2 questions (easy)
> >
> > The questions of subjective round were
> > 1.Find the first non repeating character in a string , do it in O(n)
> > time and O(1) space , use one bit per character for checking
> > repeatedness.
> > 2.Write test cases for find and replace function of notepad .
> >
> > The questions of objective round were:
> > 1.Some address calculation in array
> > 2.Input-Output
> > 3.A question involving classes , we were asked what a function was
> > doing ( very simple )
> > 4.A question involving some set operations
> > 5.Find the percentage of occupancy in a disk ( this is the one that
> > was repeated )
> > 6.A question involving the use of scanset in scanf .
> > 7.What gcc stands for ( yes , they actually asked it )
> > 8.A function involving use of this statement (int)(x + 0.5) , again a
> > repeated question :)
> >
> > Thats all i remember :)
> >
> > Anurag Atri
> > Delhi College Of Engineering
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>


-- 
Saurabh Singh
B.Tech (Computer Science)
MNNIT ALLAHABAD

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to