You are to implement a binary search or avl tree containing


Criminal Records

In Microsoft visual studio 2010 C# (Windows Form Application):

You are to implement a Binary Search or AVL tree containing the details of known criminals.  The criminal object must minimally contain the following information

  • Name
  • Age
  • Height
  • List of Offences (use the built in LinkedList<> collection)
  • Address

Store the objects in the tree using the name as the key for comparison.

You must implement a GUI (may be multiple forms) which allows the user  to  :

1.       Add a Criminal

2.       Display the number of Criminal Records in the system and depth of the tree

3.       Search for a Criminal by Name

4.       Remove a Criminal

5.       Edit a Criminal's details

6.       Search for  Criminals by a particular offence - should display all criminals committing that offence

The last two can be coded using the IComparable interface and implementing CompareTo as below (requires completing).  Alternatively you could use a non generic Tree though this will restrict the marks available.

      public int CompareTo(object obj)

        {

            if (obj is Criminal) //compare by name

            {

                Criminal other = (Criminal)obj;

                return name.CompareTo(other.name);

            }

            if (obj is string) //compare against list of crimes

            {

 

            }

            else

                return -999;  //indicates can't make a comparison

        }

You can add events to controls in design time by selecting the control and clicking on the lightening strike in the properties box. Then select the event you want to add.

1547_Criminal Records.png

 

Event documentation can be found at MSDN (google it).

222_Criminal Record 1.png

Criminal Offences : you can set or get (a property) for a linkedList. This list can be populated with the crimes using the .AddFirst(string) method and displayed on a form using get and iterating through the list contents (foreach) and adding to a ListBox for example.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: You are to implement a binary search or avl tree containing
Reference No:- TGS0647368

Now Priced at $40 (50% Discount)

Recommended (96%)

Rated (4.8/5)