开发者

Interview Question - Binary Search Tree [closed]

开发者 https://www.devze.com 2023-02-18 22:38 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, 开发者_开发技巧incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form.
It's difficult to tell what is being asked here. This question is ambiguous, vague, 开发者_开发技巧incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消