Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write the definition of the function nodeCount that returns the number of nodes in the binary tree.Add this function to the class binaryTreeType and create

Write the definition of the function nodeCount that returns the number of nodes in the binary tree.Add this function to the class binaryTreeType and create a program to test this function.

main.cpp:

task:

Method nodeCount implemented

Build Status

Build Failed

Build Output

CMakeFiles/runTests.dirt-test-6a4406ad.cpp.o: In function `binaryTreeType::treeNodeCount() const': nt-test-6a4406ad.cpp:(.text._ZNK14binaryTreeTypeIiE13treeNodeCountEv[_ZNK14binaryTreeTypeIiE13treeNodeCountEv]+0x1f): undefined reference to `binaryTreeType::nodeCount(nodeType*) const' collect2: error: ld returned 1 exit status make[2]: *** [runTests] Error 1 make[1]: *** [CMakeFiles/runTests.dir/all] Error 2 make: *** [all] Error 2

Test Contents

bSearchTreeType treeRoot; TEST(Tree,1) { ASSERT_EQ(treeRoot.treeNodeCount(), 0); treeRoot.insert(1); treeRoot.insert(434); treeRoot.insert(245); ASSERT_EQ(treeRoot.treeNodeCount(), 3); treeRoot.insert(543); treeRoot.insert(5563); treeRoot.insert(324532); ASSERT_EQ(treeRoot.treeNodeCount(), 6); treeRoot.insert(3245332); ASSERT_EQ(treeRoot.treeNodeCount(), 7); }

image text in transcribed

image text in transcribed

Programming Exercise 19-1 Programming Exercise 19-1

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_2

Step: 3

blur-text-image_3

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

Seven Databases In Seven Weeks A Guide To Modern Databases And The NoSQL Movement

Authors: Eric Redmond ,Jim Wilson

1st Edition

1934356921, 978-1934356920

More Books

Students also viewed these Databases questions