Question
Asked by:
$25.00 Binary Search Tree in C++
- From Computer-Science: Object-Oriented-Programming , Computer-Science: Programming-Methods
- Closed, but you can still post tutorials
- Due on Mar. 03, 2009
- Asked on Feb 26, 2009 at 4:02:54PM
Q:Consider the problem of organizing a collection of user-id's and passwords. Each time a user logs in to the system by entering his or her user-id and a secret password, the system must check their validity. Because this validation must be done many times each day, it is necessary to structure this information in such a way that it can be searched rapidly. Moreover, this must be a dynamic structure because new users are regularly added to the system. BST's can searched rapidly and it is a dynamic structure. Thus, the major operations needed are provided in the BST class.
* Build a BST of UserInfo objects. (Is there an STL that will assist programmers who are constructing BST's?)
* Search the BST for a given UserInfo object entered from the keyboard.
* Display a meassage indicating if the user is a valid user or not.
The class UserInfo will have the user-id and password (both strings) as data members. Since searching and inserting into a BST requires being able to compare values stored in it with < and ==, we must overload these operators for UserInfo. And we also need an input operation, so we will overload >> for it.



