Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

//I need working and clear solution Write a function that inserts the nodes of a binary tree into an ordered linked list. Also, write a

//I need working and clear solution

Write a function that inserts the nodes of a binary tree into an ordered linked list. Also, write a program to test your function.

Do not change anything in the supplied Ch19_Ex9.cpp except to add documentation and your name.

Please use the file names listed below since your file will have the following components: Ch19_Ex9.cpp shown below

//Data //68 43 10 56 77 82 61 82 33 56 72 66 99 88 12 6 7 21 -999

#include #include "binarySearchTree.h" #include "orderedLinkedList.h"

using namespace std; int main() { bSearchTreeType treeRoot; orderedLinkedList newList; int num;

cout << "Enter numbers ending with -999" << endl; cin >> num;

while (num != -999) { treeRoot.insert(num); cin >> num; }

cout << endl << "Tree nodes in inorder: "; treeRoot.inorderTraversal(); cout << endl; cout << "Tree Height: " << treeRoot.treeHeight() << endl; treeRoot.createList(newList);

cout << "newList: "; newList.print(); cout << endl; system("pause");

return 0; } binarySearchTree.h binaryTree.h linkedList.h orderedLinkedList.h

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Access Patterns Database Interactions In Object Oriented Applications

Authors: Clifton Nock

1st Edition

0321555627, 978-0321555625

More Books

Students also viewed these Databases questions