Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Java Graph Depth-First-Seach toString()

 
Greenhorn
Posts: 7
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Guys,

I am having a little problem and I am trying to understand the problem. Apparently, something is not working with my Hierarchy class or Parenthesis class but when I just try to print my graph with the DirectedGraph toString, it print just fine. with the ParenthesizedList I get ( ( ) ). With the Hierarchy class, I get nothing. what am I missing?



my file has the following
ClassA ClassC ClassE ClassJ
ClassB ClassD ClassG

Thank you for the helps

 
Marshal
Posts: 70684
288
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will have all sorts of problems if you use the same object operator == on Strings.
 
Pat Watson
Greenhorn
Posts: 7
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:You will have all sorts of problems if you use the same object operator == on Strings.



I have changed all == to equal() in those instances but still the same.

It seems the problem is at the Hierarchy and ParenthesizedList classes at while(classesNodes.size()>0)...When it is used in the dfsUtility(), it does not seem to receive anything?
 
Pat Watson
Greenhorn
Posts: 7
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Pat Watson wrote:Hello Guys,

I am having a little problem and I am trying to understand the problem. Apparently, something is not working with my Hierarchy class or Parenthesis class but when I just try to print my graph with the DirectedGraph toString, it print just fine. with the ParenthesizedList I get ( ( ) ). With the Hierarchy class, I get nothing. what am I missing?



my file has the following
ClassA ClassC ClassE ClassJ
ClassB ClassD ClassG

Thank you for the helps



Here is what I have now but it is only reading the parent vertex and not the children vertices. Why?
 
It's a tiny ad only because the water is so cold.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic