Microsoft Interview Question: Write a method to traverse a ... | Glassdoor

Interview Question

Software Development Engineer II Interview Redmond, WA

Write a method to traverse a Binary Tree

Answer

Interview Answer

1 Answer

0

recursive:
fun traverse(t)
  print t
  if (t is leaf)
  else
      traverse(t.left)
      traverse(t.right)

Javier on Aug 6, 2010

Add Answers or Comments

To comment on this, Sign In or Sign Up.