google phone interview# JobHunting - 待字闺中
i*n
1 楼
The interviewer mentioned if given a perfect balanced BST, if we have the
min node and continuously call the successor function n times.(n is the
number of nodes)So that we could have the in order traverse of the BST. Then
what's the complexity of this algorithms? He said the complexity is O(N),
could anybody help me with this? I am a little bit confused.
min node and continuously call the successor function n times.(n is the
number of nodes)So that we could have the in order traverse of the BST. Then
what's the complexity of this algorithms? He said the complexity is O(N),
could anybody help me with this? I am a little bit confused.