Re: Microsoft Interview Questions




kool_guy wrote:

Q2) What is an efficient way to determine whether a string is a
permutation of another string? What is your run time?
storing the occurence of each char in the string in two arrays each for
one string. comparing the two arrays at the end. Equality of the two
arrays means that the given strings are permutations of each other..

.



Relevant Pages

  • Re: split a string
    ... But this reads a string into a single char ... Check fgetsfrom the Standard C Library as a way to get string input ... pointer to a pointer to a char. ... To handle arrays remotely. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Parsing between a character and sysmbol
    ... I did say was that your statement of avoiding arrays inside loops whenever ... creating new String objects. ... This is what I got inside its main loop (I'm not ... the "-" char into an array of chars. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: trying to construct an array.....corrected
    ... May I ask why this char is volatile? ... (which points to the string literal in question). ... Arrays are meant for a collection of data of the same type. ... What you're looking for is a struct. ...
    (comp.lang.c)
  • Re: Need a little help
    ... for the information to add to the arrays. ... JTextPane textPane = new JTextPane; ... String newArtist = JOptionPane.showInputDialog(null, "Please enter ... }//end public void actionPerformed ...
    (comp.lang.java.programmer)
  • Need a little help
    ... for the information to add to the arrays. ... JTextPane textPane = new JTextPane; ... String newArtist = JOptionPane.showInputDialog(null, "Please enter ... }//end public void actionPerformed ...
    (comp.lang.java.programmer)