Tree datastructures: Difference between revisions

Content added Content deleted
m (→‎{{header|Haskell}}: Reduced the forest notation, for legibility, in the Data.Tree version)
Line 523: Line 523:
nativeForest =
nativeForest =
[ Node
[ Node
{ rootLabel = "RosettaCode",
"RosettaCode"
subForest =
[ Node
[ Node
"rocks"
{ rootLabel = "rocks",
[ Node "code" [],
subForest =
Node "comparison" [],
[ Node
Node "wiki" []
{ rootLabel = "code",
],
subForest = []
Node
},
"mocks"
Node
[Node "trolling" []]
],
{ rootLabel = "comparison",
subForest = []
},
Node
{ rootLabel = "wiki",
subForest = []
}
]
},
Node
{ rootLabel = "mocks",
subForest =
[ Node
{ rootLabel = "trolling",
subForest = []
}
]
}
]
},
Node
Node
{ rootLabel = "Some lists",
"Some lists"
subForest =
[ Node "may" [],
[ Node
Node "be" [],
{ rootLabel = "may",
Node "irregular" []
subForest = []
]
},
Node {rootLabel = "be", subForest = []},
Node {rootLabel = "irregular", subForest = []}
]
}
]</lang>
]</lang>
{{Out}}
{{Out}}