kher.ajinkya
BAN USER
Comments (3)
Reputation 10
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
aap dude hain... correct solution. I certify it!
- kher.ajinkya February 16, 2012Comment hidden because of low score. Click to expand.
1
of 1 vote
>>> Jay Shri Ram - Data ek Raam, bhikhari sari duniya ||
This be the structure of the node
struct node {
string data;
hash_map<string,struct node*> children };
Let root node be a dummy node. node *root=new node(); root->data="dummy";
1. Scan the input string.
2. str1= getNextString(); eg. \documents\school\
3. str= getNextToken(str1) ; eg. "\"
3. node *p=root;
4. while(str!=NULL) {
4.1 if(p->children[str]==NULL) {
4.1.1 node *temp=new node(); temp->data=str; p->children[str]=temp; }
4.2 p=p->children[str];
4.3 str=getNextToken(str1); eg. "\" done, now "documents" and so on...
}
5. Go to step 2. //Finish all strings
_/\_ Siyawar Ramchandra ki jai _/\_
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
kya baat hain...
- kher.ajinkya February 16, 2012jus make it an absolute difference...