Modify the code so that a search of tree also stores depth

Assignment Help Computer Engineering
Reference no: EM131877932

Project Assignment

For this project, you will perform a series of searches for 1000+ objects stored in a Binary Search Tree, an AVL Tree, and a Splay Tree. For each search, you will record how many objects you had to visit to complete the search. You will analyze your results from the different data
structures.

Implement

- You should have your 1000+ objects stored in a vector (I recommend you start with your Project 2 code). Add at least three more dummy objects to the vector. That way, you only need integer indexes to determine which objects you are searching for, and you will have at least three objects in the vector that will not be in the tree structures.

- Say you have N objects in your vector. You will need to create three ?les of integers: a sorted list in range [0, N-1]; a random ordering of the same integers; and a list of integers [0, N/5] that repeat each integer ?ve times in a row (i.e. 0 0 0 0 0 1 1 1 1 1 2 2 2 2 2 etc.)

- Store the objects (excluding the dummy objects you added to the vector) in a Binary Search Tree, an AVL Tree, and a Splay Tree. I recommend that you start with the textbook code. Note that you will need to overload the <, >, ==, and << operators to compare two objects of your class. You should copy the entire class from the textbook (don't cherry pick parts or your program will have memory leaks). Any code that is not original must be cited in your writeup (including textbook code).

- Modify the code so that a search of the tree also stores the depth of the last node visited. I recommend that you pass the address of an integer to the contains method and modify it inside the method(s).

- Read in from each of the three ?les, an integer at a time, searching for the object at that integer index in the vector. Search the BST, the AVL tree, and the Splay tree. Store the depths of each search.

- Analyze the data. Plot graphs of the depths for the 1000+ searches in each of the three tree structures. Look at maximums, minimums, averages, and patterns, compare and contrast the different tree structures for each data ?le, and draw conclusions about when you would use each tree structure. Discuss complexities and their effects. All of this will go in your writeup.

- You must submit your .cpp ?le(s), your data ?le(s) (including the three integer ?les), and your writeup. Please submit your writeup in PDF format.

- Setting timers to record how long it takes you to search for the objects in each data structure
- Creating more integer ?les and seeing their effects
- Performing the same experiments on 100, 200, 300, ...N objects and graphing the results.

Reference no: EM131877932

Questions Cloud

What was the car momentum change : Dale Earnhardt's crash in Daytona 500, his car 1545kg crashed into the wall. Dale experienced a velocity change of 19 m/s for a time of 80 milliseconds.
What is the average number of hungry people waiting in line : What is the average number of hungry people waiting in line at Harry's? (Round your answer to 2 decimal places.)
Determining the isochoric process : Prove that in an adiabatic process, this gas entropy S increases with increase volume V.
Analyze important factors regarding initial selection method : Identify and analyze the most important factors regarding initial selection methods; and how effective are these methods.
Modify the code so that a search of tree also stores depth : Modify the code so that a search of the tree also stores the depth of the last node visited. Creating more integer ?les and seeing their effects.
Constant horizontal force of magnitude : A constant horizontal force of magnitude FH = 3 N is applied to m1. Find the forces (vectors!) exerted on m1 by m2 and on m2 by m3.
What is the average angular velocity : What is the average angular velocity of the turntable at t=9, from rest?
Determine errors in the given research scenario : Identify the dependent variable, independent variable and the most obvious errors in the following research scenario.
Connection between performance management and job analysis : Identify the connection and importance between performance management, job analysis and compensation. Discuss how organizations might approach compensation.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd