Software Engineer Intern Interview Questions

9,750 software engineer 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 371 - 380 interview questions

Glassdoor has 9,750 interview questions and reports from Software engineer intern interviews. Prepare for your interview. Get hired. Love your job.