|
|
|
|
|
by narribbi
3337 days ago
|
|
Balancing a binary tree is just an algorithm, like there are so many. As a programmer, you have to design algorithms on the fly, quite a few of which may actually be harder than just balancing a binary tree. Algorithms emerge automatically from designing data structures; when you end up manipulating these data structures. In turn, data structures emerge naturally from trying to model particular problems. There are too many branches in mathematics modeling too many types of problems than anybody could know them all. In that sense, asking a developer about how to balance a binary tree, is a dumb interview question. He should only know, if he happened to have worked on exactly that type of problem, only yesterday or so. The question is rather: If the following is the description of the algorithm to balance binary trees, show that you understand it by dealing with the details in the following examples. |
|