• Post Reply Bookmark Topic Watch Topic
  • New Topic

LinkedBinarySearchTree  RSS feed

 
Ryan O'Neill
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to use LinkedBinarySearchTree but a lot of the variables are protected in BinaryTreeNode. I am creating a BinaryTreeNode object but it still isn't allowing me to use them. The variables I am trying to use are element, left, and right.

 
Ryan O'Neill
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the simple fix just to make the variables public? What are the consequences of that?
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ryan O'Neill wrote:Is the simple fix just to make the variables public? What are the consequences of that?


Well, you didn't show use the code for the BinaryTreeNode, but guessing from the usage, aren't there available setters and getters?

Henry
 
Ryan O'Neill
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ahh yes Thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!