Pergunta de entrevista da empresa Jane Street

Give the type of a binary tree and an algorithm to compute its depth

Respostas da entrevista

Sigiloso

5 de nov. de 2010

type 'a tree = Leaf | Node of 'a * 'a tree * 'a tree let depth = function | Leaf -> 0 | Node (_, left, right) -> 1 + max (depth left) (depth right)

6

Sigiloso

26 de jan. de 2012

rec

2

Sigiloso

4 de out. de 2012

You wrote that you declined the offer, not that you weren't given an offer. :P

3

Sigiloso

26 de jan. de 2012

heh.. probably why I didn't get the job :P