Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Decision tree  RSS feed

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, am working on binary trees, and wanted to make a little program that takes the user through a series of questions. I was thinking of using the well-known decision tree of how to deal deal with a mess-up: Did you break it? Did anyone see you? Can you blame it on anyone else? I cannot quite remember it. Does anyone know the questions or have the URL of a site that shows it? Would be very grateful indeed!

Thanks!
Flo
 
Ranch Hand
Posts: 221
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this what you mean?
 
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just bookmarked that on my forehead. Thank you!
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I gotta remember that one!
 
Flo Powers
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah, yes, that's the one! Thank you so much!
Flo
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is this something popular that is related to binary trees?
 
David Harkness
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by kiennjal shah:
is this something popular that is related to binary trees?

No, binary trees specifically involve sorting the values in the tree for faster lookup, insertion, etc.

A decision tree instead labels each edge (connection from one node to another). A node has a question (decision) with multiple edges leading to other nodes. Once you have an answer to the question, you navigate the edge with the matching answer.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!