Pregunta de entrevista de NetApp

Write a function to construct a binary search tree given a string in postorder notation ("abcdefg").

Respuestas de entrevistas

Anónimo

1 dic 2012

int i=0; struct node *nthlast = NULL; struct node *tmp = head; while (tmp) { if (nthlast) { nthlast = nthlast -> next; tmp = tmp->next; continue; } i++; if (i == n) nthlast = head; tmp = tmp->next; } return (nthlast);

Anónimo

24 mar 2012

It is impossible. You need two strings of different notations to reconstruct the tree...

2