Programming  >  STUDY GUIDE  >  Irvine Valley College - CS 41Assignment3_BST (All)

Irvine Valley College - CS 41Assignment3_BST

Document Content and Description Below

/* Program Specification: Build a binary search tree, using links (not an array) for 15 records. The data in these records will hold names and their associated weights. Read the data from the scre ... en. Required functionality (Each # should be separate methods): 1. Build the tree from the unique set of names (names are the key value) and their associated weights. 2. Execute a preorder traversal 3. Execute an inorder traversal 4. Execute a postorder traversal 5. Find and print the height of the tree using recursion, do not add a height variable to the tree structure, the algorithm stack should hold this. 6. Determine the number of leaves and print the result (remember a leaf has no children). 7. Implement search functionality that will search for a name and indicate the weight for that individual if they exist in the structure, otherwise stating no match exists. 8. Determine the lowest weight contained in the tree. 9. Find the first name in alphabetical order (this should not go through every node, unless the tree happens to be a linked list). */ #include<iostream> #include<string> using namespace std; // elements of a node, including the name and its associated weight struct Node{ string name; float weight; Node* left; Node* right; }; // Form a new node based on the inputted name and weight Node* node(string name, floa [Show More]

Last updated: 3 years ago

Preview 1 out of 11 pages

Buy Now

Instant download

We Accept:

Payment methods accepted on Scholarfriends (We Accept)
Preview image of Irvine Valley College - CS 41Assignment3_BST document

Buy this document to get the full access instantly

Instant Download Access after purchase

Buy Now

Instant download

We Accept:

Payment methods accepted on Scholarfriends (We Accept)

Reviews( 0 )

$7.00

Buy Now

We Accept:

Payment methods accepted on Scholarfriends (We Accept)

Instant download

Can't find what you want? Try our AI powered Search

120
0

Document information


Connected school, study & course


About the document


Uploaded On

Mar 28, 2021

Number of pages

11

Written in

All

Seller


Profile illustration for Muchiri
Muchiri

Member since 4 years

209 Documents Sold

Reviews Received
19
5
1
1
6
Additional information

This document has been written for:

Uploaded

Mar 28, 2021

Downloads

 0

Views

 120

Document Keyword Tags

Recommended For You

Get more on STUDY GUIDE »

$7.00
What is Scholarfriends

Scholarfriends.com Online Platform by Browsegrades Inc. 651N South Broad St, Middletown DE. United States.

We are here to help

We're available through e-mail, Twitter, Facebook, and live chat.
 FAQ
 Questions? Leave a message!

Follow us on
 Twitter

Copyright © Scholarfriends · High quality services·