Adobe Interview Question






Comment hidden because of low score. Click to expand.
2
of 2 vote

We just need an implementation of queue using 2 stacks.

- Rohan July 25, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

bfs using stack i think we can implement the queue using the two stack using taht concept we can implement the BFS with the stack

if a tree is N-ary tree
#define N 100
struct node
{
int item;
struct node *child[N]
}root;
where N can be any given random number
void BfsTraversal(struct node *root)
{
struct node *temp;
enquee(root);
while(!isEmpty())
{
temp=Dequee();
printf("%d",temp->value);
if(temp->left)
Enquee(temp->left);
if(temp->right)
Enquee(temp->right);
}
}

- geeks July 22, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

use dfs of height 1 at each node

- ... August 18, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

will level order traversal do?

- Anonymous January 29, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

if we directly use stack then that would be a dFS

- geeks July 22, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

use dfs of height 1 at each node

- ... August 18, 2011 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More