Branching Databases.
We are going to sort a set of animals
using a branching database.
Cow Pig
Sheep Horse
(Pretend you do not know their names)
Sort the objects into 2 groups with a
clear yes/no question.
Does the animal have horns?
Cow Sheep Pig Horse
Yes No
Sort the objects again using a simple
yes/no question.
Is the animal covered in wool?
Cow Sheep
Yes No
Do the same with the remaining
objects.
Does the animal have a curly tail?
Pig Horse
Yes No
You have now created a simple
branching database.
Yes
Is the Sheep
animal
covered
Yes in wool? No
Does the Cow
animal
have
horns?
No
Yes
Pig
Does the
animal
have a
curly tail? No
Horse