vikdp01
BAN USER- 0of 0 votes
AnswersMS written test:
- vikdp01 in India
Given a list of words and a dictionary with many words. The dictionary may or may not include the the given list of words.
From the given list of words,you need to print only those words which are present in dictionary.
Mention time complexity.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer String Manipulation - -2of 2 votes
AnswersMS written test:
- vikdp01 in India
STRINGZ = STRINGX + STRINGY.charAt(index) ,
How can it be done using C language.
Also, I want to add a character in each function call.
e.g.
FUNC(mainstr,"");
FUNC(char *mainstr, char *current)
{
if(index==strlen(mainstr))
print("%s",current);
else
for(int i=0; i<strlen(mainstr) ; i++)
{
FUNC(mainstr, current+mainstr.charAt(i))
}
}
//replace current+mainstr.charAt(i) with C functions and code ..| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer String Manipulation - -1of 1 vote
AnswersGiven a list of strings, Print all possible letter strings in sorted order.
- vikdp01 in India
Remember that the characters in each string are sorted.
Sample I/P:
YZ
ABCD
DEF
O/P:
ADY
ADZ
AEY
AEZ
AFY
AFZ
BDY
BDZ
BEY
BEZ
BFY
BFZ
CDY
CDZ
CEY
CEZ
CFY
CFZ| Report Duplicate | Flag | PURGE
String Manipulation
Hey nice approach.
Your o/p works if we take input in the sorted order.
abc,def,yz
Anyways, We can sort the strings before calling the PrintSorted func.
Can you suggest me a good algo which can sort strings( in general) and also in this case where only the first char in each string is sufficient to sort the strings.
e.g.
I/P: DEFG YZ ABC
O/P: ABC DEFG YZ
Hi, can u please share ur experience and questions in case u had an interview with Amazon recently .. Did you try for Amazon hyd /blr ? . Thanks
- vikdp01 March 31, 2012