Write An Essay logo
  • Home
  • Dissertation Writing
  • Essay Writing
  • Personal Statement
  • My account
  • Order now
Order Now
Uncategorized

Lab 4 – Binary Search Trees

2 min read
Posted on 
November 16th, 2021
Home Uncategorized Lab 4 - Binary Search Trees

 

Follow all code styling and submission instructions as outlined for previous labs.

  • Declare and implement a BSTNode ADT with a data attribute and two pointer attributes, one for the left child and the other for the right child. Implement the usual getters/setters for these attributes.
  • Declare and implement a BST as a link-based ADT whose data will be Dollar objects – the data will be inserted based on the actual money value of your Dollar objects as a combination of the whole value and fractional value attributes.
  • For the BST, implement the four traversal methods as well as methods for the usual search, insert, delete, print, count, isEmpty, empty operations and any other needed.
  • Your pgm will use the following 20 Dollar objects to be created in the exact order in your main to seed the tree:
      1. $57.12
      2. $23.44
      3. $87.43
      4. $68.99
      5. $111.22
      6. $44.55
      7. $77.77
      8. $18.36
      9. $543.21
      10. $20.21
      11. $345.67
      12. $36.18
      13. $48.48
      14. $101.00
      15. $11.00
      16. $21.00
      17. $51.00
      18. $1.00
      19. $251.00
      20. $151.00
  • Also, create an output file to write program output as specified in one or more instructions below.
  • After seeding the data, perform your traversal operations in the specific sequence of breadth-first, in-order, pre-order, post-order, ensuring that output is written out to both screen and file concurrently.
  • Then provide interactivity for the user to add/search/delete nodes from the console after the data has been seeded into the application.
  • Perform adequate input data validation when reading data from the user into the tree – if any data item is invalid, ignore the data item and continue to next item but print a message to output (both screen and same output file) to indicate which data items were ignored.
  • Also, provide the user the option to print output of traversals or exit the program. Once the user selects the option to print data or exits the program, the data in the BST should be printed out to both screen and output file in all four traversal methods in the specific sequence of breadth-first, in-order, pre-order, post-order.
  • For submission – upload your BST, Dollar/USD and main code files, screenshots of console window and your output files only.

Any other questions or clarifications – ask on the forum first.

Grading:

  • 25 pts – EXE created from your code works from command line.
  • 45 pts – BSTNode and BST ADT
  • 30 pts – Your main
  • 15 pts extra credit – demonstrate use of your Lab 4 queue without any modifications for the tree traversals

Order an Essay Now & Get These Features For Free:

Turnitin Report

Formatting

Title Page

Citation

Outline

Place an Order
Share
Tweet
Share
Tweet
Calculate the price
Pages (275 words)
$0.00
Write An Essay
Company
  • Why Choose Us
  • About Us
  • Terms
  • Dissertation Help
  • Personal Statement
  • Research Paper Format
  • Term Papers
Legal
  • Write My Essay
  • Thesis Format
  • Custom Papers
  • Coursework Writing
  • Dissertation Writing
  • Essay Writing
How Our Service is Used:
Write An Essay essays are NOT intended to be forwarded as finalized work as it is only strictly meant to be used for research and study purposes. Write An Essay does not endorse or condone any type of plagiarism.
Subscribe
No Spam
© 2023 Write An Essay. All rights reserved.
Write An Essay will be listed as ‘Write An Essay’ on your bank statement.