Frage im Vorstellungsgespräch bei Garmin

Implement binary search.

Antworten zu Vorstellungsgespräch

Anonym

8. Juni 2010

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

Anonym

7. März 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; }