mirandaxu789
BAN USER
Comments (5)
Reputation 0
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
void printtree(queue<Node*>& qq)
{
if (qq.size()==0) {
return;
}
queue<Node*> mqq;
while (qq.size()) {
Node* temp=qq.front();
qq.pop();
cout << temp->data << ' ';
if (temp->child) {
temp=temp->child;
mqq.push(temp);
while (temp->sib) {
temp=temp->sib;
mqq.push(temp);
}
}
}
cout << endl;
printtree(mqq);
}
Comment hidden because of low score. Click to expand.
0
of 0 vote
It's not binary search tree.
- mirandaxu789 March 13, 2012Comment hidden because of low score. Click to expand.
0
of 0 vote
hashmap uses additional space
- mirandaxu789 March 12, 2012Comment hidden because of low score. Click to expand.
0
of 0 vote
hashmap uses additional space
- mirandaxu789 March 12, 2012Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
void foo(int n,vector<int>& vv)
- mirandaxu789 April 06, 2012{
int lim=n;
for (int i=1; i<=lim; i++) {
if (n%i==0) {
vv.push_back(i);
if (i!=n/i)
vv.push_back(n/i);
}
lim=n/i;
}
}