Garmin Interview Question

Implement binary search.

Interview Answers

Anonymous

Jun 8, 2010

Ah, yes. I found the binary....

Anonymous

Mar 7, 2012

struct treeNode { int val; struct treeNode *left; struct treeNode *right; }; struct treeNode *find(struct treeNode *p, int val) { if (val val) return find(p->left, val); else if (val > p->val) return find(p->right, val); else return p; }