Developer Intern Interview Questions

12,170 developer intern interview questions shared by candidates

Given the root node of a tree, write two Java programs to visit all nodes of the tree, one in a depth-first fashion and the other in a breadth-first fashion, both without using recursion. Assume a node is represented by a class named Node, which has a method children() that returns a list of child nodes. Call node.visit() to visit a node.
avatar

Software Engineer Intern

Interviewed at Motorola Mobility

4.2
Mar 19, 2009

Given the root node of a tree, write two Java programs to visit all nodes of the tree, one in a depth-first fashion and the other in a breadth-first fashion, both without using recursion. Assume a node is represented by a class named Node, which has a method children() that returns a list of child nodes. Call node.visit() to visit a node.

Viewing 421 - 430 interview questions

Glassdoor has 12,170 interview questions and reports from Developer intern interviews. Prepare for your interview. Get hired. Love your job.