Interview Question - Binary Search Tree [closed]
A friend was recently interviewed for a position at a tech company and was given 4 programming tasks.
One of the tasks was to implement a Binary Search Tree class using a Linked List implementation with search, add and remove methods that could be accessed in a thread-safe manner. He had Visual Studio 2010 but no internet connection and around 30mins.
I'd like to see people here attempt a solution without an internet connection in 30mins in C# (impossible to police I know but I trust you to be honest...)
Why? Traversing the LL would be ridiculously slow, right? Sounds like a dumb question.
(Edit:) Do you mean that you have to store your BST in a Linked List? Or that it has to support an interface like a linked list? I was assuming the former.
精彩评论